xfs
[Top] [All Lists]

Re: XFS assertion from truncate. (3.10-rc2)

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: XFS assertion from truncate. (3.10-rc2)
From: Dave Jones <davej@xxxxxxxxxx>
Date: Tue, 21 May 2013 22:56:05 -0400
Cc: Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130522001603.GZ29466@dastard>
Mail-followup-to: Dave Jones <davej@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <20130521225257.GA12713@xxxxxxxxxx> <20130521233429.GW29466@dastard> <20130521234016.GB14347@xxxxxxxxxx> <20130521235410.GY29466@dastard> <20130522000803.GA19891@xxxxxxxxxx> <20130522001603.GZ29466@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, May 22, 2013 at 10:16:03AM +1000, Dave Chinner wrote:

Seems like I can trigger this from paths other than truncate too.. (eg, 
sys_open)

Here's what I ended up with for debug

diff --git a/fs/dcache.c b/fs/dcache.c
index 2b39d16..b579dfe 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2792,6 +2792,7 @@ char *dentry_path(struct dentry *dentry, char *buf, int 
buflen)
 Elong:
        return ERR_PTR(-ENAMETOOLONG);
 }
+EXPORT_SYMBOL(dentry_path);
 
 /*
  * NOTE! The user-level library version returns a
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index d82efaa..8419e63 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -47,6 +47,7 @@
 #include <linux/security.h>
 #include <linux/fiemap.h>
 #include <linux/slab.h>
+#include <linux/dcache.h>
 
 static int
 xfs_initxattrs(
@@ -714,9 +715,20 @@ xfs_setattr_size(
                return XFS_ERROR(error);
 
        ASSERT(S_ISREG(ip->i_d.di_mode));
-       ASSERT((mask & (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
+       if ((mask & (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET|
                        ATTR_MTIME_SET|ATTR_KILL_SUID|ATTR_KILL_SGID|
-                       ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0);
+                       ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0) {
+
+               struct dentry *dentry = d_find_any_alias(VFS_I(ip));
+               char buf[MAXPATHLEN];
+
+               dentry_path(dentry, buf, MAXPATHLEN);
+               dput(dentry);
+               xfs_warn(mp, "%s: mask 0x%x mismatch on file %s\n",
+                        __func__, mask, buf);
+
+                ASSERT(0);
+       }
 
        if (!(flags & XFS_ATTR_NOLOCK)) {
                lock_flags |= XFS_IOLOCK_EXCL;


Something isn't right though I think.. Because the filenames it outputs
look like crap.

[   71.406552] XFS (sda2): xfs_setattr_size: mask 0xa068 mismatch on file 
0\xffffffee<\xffffff88\xffffffff\xffffffff\xffffff80O\xffffff82\xffffffff\xffffffff\xffffffff\xffffffff

The mask is always 0xa068 though if that helps.

        Dave

<Prev in Thread] Current Thread [Next in Thread>