summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2010-11-19 03:18:02 +0100
committerChris Mason <chris.mason@oracle.com>2010-11-22 04:26:08 +0100
commit76195853903ca613ba722203db9b747d70478fc7 (patch)
treed3c7af7f141566a1ca2acfdf1efccd374b5e349f
parentBtrfs: handle NFS lookups properly (diff)
downloadlinux-76195853903ca613ba722203db9b747d70478fc7.tar.xz
linux-76195853903ca613ba722203db9b747d70478fc7.zip
Btrfs: fix more ESTALE problems with NFS
When creating new inodes we don't setup inode->i_generation. So if we generate an fh with a newly created inode we save the generation of 0, but if we flush the inode to disk and have to read it back when getting the inode on the server we'll have the right i_generation, so gens wont match and we get ESTALE. This patch properly sets inode->i_generation when we create the new inode and now I'm no longer getting ESTALE. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index eed357ff6c99..fc22f556aa24 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4501,6 +4501,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
BTRFS_I(inode)->index_cnt = 2;
BTRFS_I(inode)->root = root;
BTRFS_I(inode)->generation = trans->transid;
+ inode->i_generation = BTRFS_I(inode)->generation;
btrfs_set_inode_space_info(root, inode);
if (mode & S_IFDIR)