From: Dan Carpenter Date: Tue, 20 Mar 2012 16:58:06 +0000 (+0000) Subject: AFS: checking wrong bit in afs_readpages() X-Git-Tag: upstream/snapshot3+hdmi~7966 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad2a8e6078a16d3b61b530f1447110841c36ae56;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git AFS: checking wrong bit in afs_readpages() We should be testing "if (vnode->flags & (1 << 4))" instead of "if (vnode->flags & 4) {". The current test checks if the data was modified instead of deleted. Signed-off-by: Dan Carpenter Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/file.c b/fs/afs/file.c index 14d89fa..8f6e923 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -251,7 +251,7 @@ static int afs_readpages(struct file *file, struct address_space *mapping, ASSERT(key != NULL); vnode = AFS_FS_I(mapping->host); - if (vnode->flags & AFS_VNODE_DELETED) { + if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) { _leave(" = -ESTALE"); return -ESTALE; }