linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] btrfs: btrfs_evict_inode must clear all inodes
Date: Mon, 29 Jan 2018 11:46:28 -0500	[thread overview]
Message-ID: <c38b2527-899f-9be2-87e5-6b4048e17217@suse.com> (raw)

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

             reply	other threads:[~2018-01-29 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 16:46 Jeff Mahoney [this message]
2018-01-29 16:48 ` [PATCH] btrfs: btrfs_evict_inode must clear all inodes Nikolay Borisov
2018-01-29 19:58 ` Liu Bo
2018-01-29 20:03   ` Jeff Mahoney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c38b2527-899f-9be2-87e5-6b4048e17217@suse.com \
    --to=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).