* [PATCH] Btrfs: fix more ESTALE problems with NFS
@ 2010-11-19 2:18 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2010-11-19 2:18 UTC (permalink / raw)
To: linux-btrfs
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>
---
fs/btrfs/inode.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6f08892..3018878 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4502,6 +4502,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)
--
1.6.6.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-19 2:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-19 2:18 [PATCH] Btrfs: fix more ESTALE problems with NFS Josef Bacik
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).