All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: [PATCH 3/3] xfs: optimize the negative xattr caching
Date: Tue, 26 Jul 2011 11:07:29 -0400	[thread overview]
Message-ID: <20110726150729.GC18000@infradead.org> (raw)
In-Reply-To: <20110726150633.GA17400@infradead.org>

Since the addition of file capabilities every write needs to read xattrs to
check if we have any capabilities to clear.  In Linux 3.0 Andi Kleen added
a flag to cache the fact that we do not have any attributes on an inode.
Make sure to already mark a file as not having any attributes when reading
it from disk in case it doesn't even have an attribute fork.  Based on an
earlier patch from Andi Kleen.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_iops.c	2011-07-25 23:49:23.011563852 +0200
+++ linux-2.6/fs/xfs/linux-2.6/xfs_iops.c	2011-07-25 23:49:50.281563691 +0200
@@ -1194,9 +1194,14 @@ xfs_setup_inode(
 		break;
 	}
 
-	/* if there is no attribute fork no ACL can exist on this inode */
-	if (!XFS_IFORK_Q(ip))
+	/*
+	 * If there is no attribute fork no ACL can exist on this inode,
+	 * and it can't have any file capabilities attached to it either.
+	 */
+	if (!XFS_IFORK_Q(ip)) {
+		inode_has_no_xattr(inode);
 		cache_no_acl(inode);
+	}
 
 	xfs_iflags_clear(ip, XFS_INEW);
 	barrier();

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

  parent reply	other threads:[~2011-07-26 15:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110726150633.GA17400@infradead.org>
2011-07-26 15:06 ` [PATCH 1/3] xfs: flag all buffers as metadata Christoph Hellwig
2011-07-26 22:38   ` Alex Elder
2011-07-26 22:40     ` Christoph Hellwig
2011-07-26 22:41       ` Alex Elder
2011-07-26 15:07 ` [PATCH 2/3] xfs: prevent against ioend livelocks in xfs_file_fsync Christoph Hellwig
2011-07-26 22:39   ` Alex Elder
2011-07-26 15:07 ` Christoph Hellwig [this message]
2011-07-26 22:39   ` [PATCH 3/3] xfs: optimize the negative xattr caching Alex Elder

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=20110726150729.GC18000@infradead.org \
    --to=hch@infradead.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.