Skip to contentSkip to conversation

AFS: checking wrong bit in afs_readpages()

PATCH New David Howells 1 participant 1 message Mar 20, 2012

Subsystems (2)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 AFS: checking wrong bit in afs_readpages()

From: Dan Carpenter <[email protected]>

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.

---

 fs/afs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/afs/file.c +1 -1
index 14d89fa..8f6e923 100644
@@ -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;
 	}