Przeglądaj źródła

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 <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dan Carpenter 13 lat temu
rodzic
commit
ad2a8e6078
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      fs/afs/file.c

+ 1 - 1
fs/afs/file.c

@@ -251,7 +251,7 @@ static int afs_readpages(struct file *file, struct address_space *mapping,
 	ASSERT(key != NULL);
 	ASSERT(key != NULL);
 
 
 	vnode = AFS_FS_I(mapping->host);
 	vnode = AFS_FS_I(mapping->host);
-	if (vnode->flags & AFS_VNODE_DELETED) {
+	if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) {
 		_leave(" = -ESTALE");
 		_leave(" = -ESTALE");
 		return -ESTALE;
 		return -ESTALE;
 	}
 	}