* [PATCH] Fix for default ACL handling on ReiserFS
@ 2004-09-16 17:12 Jeff Mahoney
0 siblings, 0 replies; only message in thread
From: Jeff Mahoney @ 2004-09-16 17:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List, ReiserFS List
[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all -
reiserfs_set_xattr() explicitly updates the ctime for the host inode.
This works for direct setfacl/setfattr calls, but for the more common
case of an inherited default ACL, it breaks. The ACL is inherited in the
middle of the new inode creation, before the inode has been hashed.
When mark_inode_dirty is called, one of the checks bails out if the
inode is unhashed -- but AFTER inode->i_state is updated, so the inode
is marked dirty but never placed on any dirty list.
Since the inode is never placed on a dirty list, __sync_single_inode
from the writeback_inodes() path can never be called on it to clear the
dirty flags. Once the inode is hashed and mark_inode_dirty is called for
it again, it's too late -- it will bail early assuming (correctly) that
the inode is already marked dirty. This ultimately results in I/O stalls
that can't be resolved by the fs path, only be the memory allocation
path that uses pages directly.
The attached patch makes the update of the ctime conditional on the
inode being hashed already.
Please apply.
- -Jeff
- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBScmYLPWxlyuTD7IRAopEAJ9uyyIudRaYd01pHvNHEGni+tO+zgCfc1Z0
zVSRILsXsk2xdvRN1/ss+5Y=
=6ndQ
-----END PGP SIGNATURE-----
[-- Attachment #2: reiserfs-acl-dirty.diff --]
[-- Type: text/plain, Size: 872 bytes --]
diff -rup linux-2.6.8/fs/reiserfs/xattr.c linux-2.6.8.fix/fs/reiserfs/xattr.c
--- linux-2.6.8/fs/reiserfs/xattr.c 2004-08-14 01:38:08.000000000 -0400
+++ linux-2.6.8.fix/fs/reiserfs/xattr.c 2004-09-16 00:22:19.000000000 -0400
@@ -588,12 +588,18 @@
if (err || buffer_size == 0 || !buffer)
break;
}
- inode->i_ctime = CURRENT_TIME;
- mark_inode_dirty (inode);
+ /* We can't mark the inode dirty if it's not hashed. This is the case
+ * when we're inheriting the default ACL. If we dirty it, the inode
+ * gets marked dirty, but won't (ever) make it onto the dirty list until
+ * it's synced explicitly to clear I_DIRTY. This is bad. */
+ if (!hlist_unhashed(&inode->i_hash)) {
+ inode->i_ctime = CURRENT_TIME;
+ mark_inode_dirty (inode);
+ }
out_filp:
up (&xinode->i_sem);
fput(fp);
out:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-16 17:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-16 17:12 [PATCH] Fix for default ACL handling on ReiserFS Jeff Mahoney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).