All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, xfs@oss.sgi.com
Subject: Re: XFS assertion from truncate. (3.10-rc2)
Date: Tue, 21 May 2013 22:56:05 -0400	[thread overview]
Message-ID: <20130522025605.GA29767@redhat.com> (raw)
In-Reply-To: <20130522001603.GZ29466@dastard>

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<\x02\xffffff88\xffffffff\xffffffff\xffffff80O\xffffff82\xffffffff\xffffffff\xffffffff\xffffffff

The mask is always 0xa068 though if that helps.

	Dave

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: Dave Jones <davej@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, xfs@oss.sgi.com
Subject: Re: XFS assertion from truncate. (3.10-rc2)
Date: Tue, 21 May 2013 22:56:05 -0400	[thread overview]
Message-ID: <20130522025605.GA29767@redhat.com> (raw)
In-Reply-To: <20130522001603.GZ29466@dastard>

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<\x02\xffffff88\xffffffff\xffffffff\xffffff80O\xffffff82\xffffffff\xffffffff\xffffffff\xffffffff

The mask is always 0xa068 though if that helps.

	Dave


  reply	other threads:[~2013-05-22  2:56 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 22:52 XFS assertion from truncate. (3.10-rc2) Dave Jones
2013-05-21 22:52 ` Dave Jones
2013-05-21 23:34 ` Dave Chinner
2013-05-21 23:34   ` Dave Chinner
2013-05-21 23:40   ` Dave Jones
2013-05-21 23:40     ` Dave Jones
2013-05-21 23:54     ` Dave Chinner
2013-05-21 23:54       ` Dave Chinner
2013-05-22  0:08       ` Dave Jones
2013-05-22  0:08         ` Dave Jones
2013-05-22  0:16         ` Dave Chinner
2013-05-22  0:16           ` Dave Chinner
2013-05-22  2:56           ` Dave Jones [this message]
2013-05-22  2:56             ` Dave Jones
2013-05-22  4:03             ` Dave Chinner
2013-05-22  4:03               ` Dave Chinner
2013-05-22  4:15               ` Dave Jones
2013-05-22  4:15                 ` Dave Jones
2013-05-22  5:12                 ` Dave Chinner
2013-05-22  5:12                   ` Dave Chinner
2013-05-22  5:29                   ` Dave Jones
2013-05-22  5:29                     ` Dave Jones
2013-05-22  5:51                     ` Dave Chinner
2013-05-22  5:51                       ` Dave Chinner
2013-05-22 14:22                       ` Dave Jones
2013-05-22 14:22                         ` Dave Jones
2013-05-22 16:19                         ` Dave Jones
2013-05-22 16:19                           ` Dave Jones
2013-05-22 22:09                           ` Dave Chinner
2013-05-22 22:09                             ` Dave Chinner
2013-05-22 23:53                             ` Dave Jones
2013-05-22 23:53                               ` Dave Jones
2013-05-23 15:17                             ` Dave Jones
2013-05-23 15:17                               ` Dave Jones
2013-05-23 18:13                               ` Dave Jones
2013-05-23 18:13                                 ` Dave Jones
2013-05-22 21:54                       ` Dave Chinner
2013-05-22 21:54                         ` Dave Chinner
2013-05-23 18:49                         ` Dave Jones
2013-05-23 18:49                           ` Dave Jones
2013-05-23 22:30                           ` Dave Chinner
2013-05-23 22:30                             ` Dave Chinner
2013-05-24  0:49                             ` Dave Jones
2013-05-24  0:49                               ` Dave Jones
2013-05-24  1:26                               ` Dave Chinner
2013-05-24  1:26                                 ` Dave Chinner
2013-05-24  1:36                                 ` Dave Jones
2013-05-24  1:36                                   ` Dave Jones
2013-05-24  1:52                                 ` Dave Jones
2013-05-24  1:52                                   ` Dave Jones
2013-05-24  3:03                                   ` Dave Jones
2013-05-24  3:03                                     ` Dave Jones
2013-05-24  8:03                                     ` Dave Chinner
2013-05-24  8:03                                       ` Dave Chinner
2013-05-24 20:16                                       ` Dave Jones
2013-05-24 20:16                                         ` Dave Jones
2013-05-25  4:58                                       ` Eric Sandeen
2013-05-25  4:58                                         ` Eric Sandeen
2013-05-25  6:39                                         ` Stan Hoeppner
2013-05-26 22:43                                           ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130522025605.GA29767@redhat.com \
    --to=davej@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.