]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: preserve i_rdev when recycling a reclaimable inode
authorAmir Goldstein <amir73il@gmail.com>
Fri, 26 Jan 2018 19:24:40 +0000 (11:24 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Jan 2018 15:27:23 +0000 (07:27 -0800)
commit06bc57b0bb59285f6d9a853b0509b588b61b0a49
treedb35d8607f69ef0531ea53b05fa552cf671d1919
parent4f964e1bad28aadb2c892f337e234431cbbaeade
xfs: preserve i_rdev when recycling a reclaimable inode

Commit 6535b45046e99 ("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: 6535b45046e99 ("xfs: remove if_rdev")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_icache.c