linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: btrfs_evict_inode must clear all inodes
@ 2018-01-29 16:46 Jeff Mahoney
  2018-01-29 16:48 ` Nikolay Borisov
  2018-01-29 19:58 ` Liu Bo
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Mahoney @ 2018-01-29 16:46 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

btrfs_evict_inode must clear all inodes or we'll hit a BUG_ON in evict().

Fixes: 3d48d9810de (btrfs: Handle uninitialised inode eviction)
Cc: Nikolay Borisov <nborisov@suse.com>
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/btrfs/inode.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5282,6 +5282,7 @@ void btrfs_evict_inode(struct inode *ino
 	trace_btrfs_inode_evict(inode);
 
 	if (!root) {
+		clear_inode(inode);
 		kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
 		return;
 	}

-- 
Jeff Mahoney
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-29 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-29 16:46 [PATCH] btrfs: btrfs_evict_inode must clear all inodes Jeff Mahoney
2018-01-29 16:48 ` Nikolay Borisov
2018-01-29 19:58 ` Liu Bo
2018-01-29 20:03   ` Jeff Mahoney

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).