summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2004-09-22 04:22:07 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-22 04:22:07 -0700
commit1a5ad5ddf544b618b590d504ac2fa80397d40a1f (patch)
treefd9bb0c028ef483a2494626432d0ff1bb49dec70
parentc88d19d6380f0a3af3bca20303ce3c6c654019e6 (diff)
[PATCH] Fix for default ACL handling on ReiserFS
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. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/reiserfs/xattr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 21ba7189ec32..39d0d9630d31 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -589,8 +589,14 @@ open_file:
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);