]> git.baikalelectronics.ru Git - kernel.git/commit
Return EBUSY from BLKRRPART for mounted whole-dev fs
authorEric Sandeen <sandeen@redhat.com>
Tue, 24 Nov 2015 23:30:34 +0000 (17:30 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 26 Nov 2015 03:49:24 +0000 (20:49 -0700)
commit4430bcdc4a6b7f4f97ed534d602931c43736f3fe
treec8100aec8d36bd1c5fcbb62d20ece162ef2fe22d
parent65258b91323cd8b11ab2304bb389a25455e69a8f
Return EBUSY from BLKRRPART for mounted whole-dev fs

Today, blockdev --rereadpt /dev/sda will fail with EBUSY if any
partition of sda is mounted (and will fail with EINVAL if pointed
at a partition).  But it will pass if the entire block device is
formatted with a filesystem and mounted.  I don't think this makes
sense; partitioning should surely not ever change out from under
a mounted device.

So check for bdev->bd_super, and fail that with -EBUSY as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/partition-generic.c