linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Eric Biggers <ebiggers3@gmail.com>,
	<linux-f2fs-devel@lists.sourceforge.net>,
	Jaegeuk Kim <jaegeuk@kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, Eric Biggers <ebiggers@google.com>
Subject: Re: [PATCH] f2fs: call unlock_new_inode() before d_instantiate()
Date: Mon, 23 Apr 2018 11:25:47 +0800	[thread overview]
Message-ID: <d3a0a778-3511-b34b-66d4-30ba02b64eaf@huawei.com> (raw)
In-Reply-To: <20180418224842.195203-1-ebiggers3@gmail.com>

On 2018/4/19 6:48, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> xfstest generic/429 sometimes hangs on f2fs, caused by a thread being
> unable to take a directory's i_rwsem for write in vfs_rmdir().  In the
> test, one thread repeatedly creates and removes a directory, and other
> threads repeatedly look up a file in the directory.  The bug is that
> f2fs_mkdir() calls d_instantiate() before unlock_new_inode(), resulting
> in the directory inode being exposed to lookups before it has been fully
> initialized.  And with CONFIG_DEBUG_LOCK_ALLOC, unlock_new_inode()
> reinitializes ->i_rwsem, corrupting its state when it is already held.
> 
> Fix it by calling unlock_new_inode() before d_instantiate().  This
> matches what other filesystems do.
> 
> Fixes: 57397d86c62d ("f2fs: add inode operations for special inodes")
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

      reply	other threads:[~2018-04-23  3:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 22:48 [PATCH] f2fs: call unlock_new_inode() before d_instantiate() Eric Biggers
2018-04-23  3:25 ` Chao Yu [this message]

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=d3a0a778-3511-b34b-66d4-30ba02b64eaf@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).