]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: update device path inode time instead of bd_inode
authorJosef Bacik <josef@toxicpanda.com>
Thu, 14 Oct 2021 17:11:01 +0000 (13:11 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:08:08 +0000 (19:08 +0200)
commit33ba936349b1fa74b9bf483771c87c7e2cba9707
treefd78049f391bcaa363c13a292df11ca4977a875b
parent5c38e352f62951056838215133ed4aa7d6f949f8
btrfs: update device path inode time instead of bd_inode

Christoph pointed out that I'm updating bdev->bd_inode for the device
time when we remove block devices from a btrfs file system, however this
isn't actually exposed to anything.  The inode we want to update is the
one that's associated with the path to the device, usually on devtmpfs,
so that blkid notices the difference.

We still don't want to do the blkdev_open, so use kern_path() to get the
path to the given device and do the update time on that inode.

Fixes: b912710376cc ("btrfs: update the bdev time directly when closing")
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c