All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfs: preserve i_rdev when recycling a reclaimable inode
@ 2018-01-26  7:44 Amir Goldstein
  2018-01-26  7:44 ` Christoph Hellwig
  2018-01-26 21:44 ` Darrick J. Wong
  0 siblings, 2 replies; 26+ messages in thread
From: Amir Goldstein @ 2018-01-26  7:44 UTC (permalink / raw)
  To: Darrick J . Wong
  Cc: Christoph Hellwig, Eryu Guan, Miklos Szeredi, linux-xfs, linux-fsdevel

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

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

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

end of thread, other threads:[~2018-03-19 15:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.