All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>, Eryu Guan <eguan@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] xfs: preserve i_rdev when recycling a reclaimable inode
Date: Fri, 26 Jan 2018 13:44:04 -0800	[thread overview]
Message-ID: <20180126214404.GE9068@magnolia> (raw)
In-Reply-To: <1516952669-14769-1-git-send-email-amir73il@gmail.com>

On Fri, Jan 26, 2018 at 09:44:29AM +0200, Amir Goldstein wrote:
> Commit 66f364649d870 ("xfs: remove if_rdev") moved storing of rdev
> value for special inodes to VFS inodes, but forgot to preserve the
> value of i_rdev when recycling a reclaimable xfs_inode.
> 
> This was detected by xfstest overlay/017 with inodex=on mount option
> and xfs base fs. The test does a lookup of overlay chardev and blockdev
> right after drop caches.
> 
> Overlayfs inodes hold a reference on underlying xfs inodes when mount
> option index=on is configured. If drop caches reclaim xfs inodes, before
> it relclaims overlayfs inodes, that can sometimes leave a reclaimable xfs
> inode and that test hits that case quite often.
> 
> When that happens, the xfs inode cache remains broken (zere i_rdev)
> until the next cycle mount or drop caches.
> 
> Fixes: 66f364649d870 ("xfs: remove if_rdev")
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> ---
> 
> Darrick,
> 
> You may want to rush this last minute v4.15 regression fix.
> 
> Thanks,
> Amir.
> 
>  fs/xfs/xfs_icache.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 3861d61fb265..3ce946063ffe 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -295,6 +295,7 @@ xfs_reinit_inode(
>  	uint32_t	generation = inode->i_generation;
>  	uint64_t	version = inode->i_version;
>  	umode_t		mode = inode->i_mode;
> +	dev_t		dev = inode->i_rdev;
>  
>  	error = inode_init_always(mp->m_super, inode);
>  
> @@ -302,6 +303,7 @@ xfs_reinit_inode(
>  	inode->i_generation = generation;
>  	inode->i_version = version;
>  	inode->i_mode = mode;
> +	inode->i_rdev = dev;
>  	return error;
>  }
>  
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-26 21:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26  7:44 [PATCH v2] xfs: preserve i_rdev when recycling a reclaimable inode Amir Goldstein
2018-01-26  7:44 ` Christoph Hellwig
2018-01-26 21:44 ` Darrick J. Wong [this message]
2018-01-29 11:07   ` Amir Goldstein
2018-01-29 15:50     ` Darrick J. Wong
2018-02-01  0:27       ` Amir Goldstein
2018-02-01  0:29         ` Amir Goldstein
2018-02-01  0:35         ` Darrick J. Wong
2018-03-11 16:08           ` Amir Goldstein
2018-03-11 16:24             ` Greg KH
2018-03-12 16:27               ` Darrick J. Wong
2018-03-12 20:16                 ` Amir Goldstein
2018-03-13  6:48                   ` Amir Goldstein
2018-03-13 12:46                     ` Amir Goldstein
2018-03-13 13:11                       ` Christoph Hellwig
2018-03-13 14:33                         ` Amir Goldstein
2018-03-13 21:50                           ` Dave Chinner
2018-03-14  6:24                             ` Amir Goldstein
2018-03-14 12:33                               ` Dave Chinner
2018-03-14 12:49                                 ` Christoph Hellwig
2018-03-14 15:45                                   ` Amir Goldstein
2018-03-14 15:46                                     ` Christoph Hellwig
2018-03-14 16:01                                     ` Darrick J. Wong
2018-03-19 13:40                               ` Greg KH
2018-03-19 14:59                                 ` Amir Goldstein
2018-03-19 15:19                                   ` Greg KH

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=20180126214404.GE9068@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.