Whamcloud - gitweb
tune2fs: check whether filesystem is in use for I_flag and Q_flag test
authorZhiqiang Liu <liuzhiqiang26@huawei.com>
Mon, 20 Mar 2023 05:04:34 +0000 (13:04 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 8 Feb 2024 16:03:19 +0000 (11:03 -0500)
commit2e42f7bfd1d818899684b2f694be24970704e39a
treea16e841e319175d27e02062e9eb563fc49e32098
parent196cd1224ccaf5ca76540fc0a6238695d4476ca9
tune2fs: check whether filesystem is in use for I_flag and Q_flag test

For changing inode size (-I) and setting quota fearture (-Q), tune2fs
only check whether the filesystem is umounted. Considering mount
namepspaces, the filesystem is umounted, however it already be left
in other mount namespace.
So we add one check whether the filesystem is not in use with using
EXT2_MF_BUSY flag, which can indicate the device is already opened
with O_EXCL, as suggested by Ted.

Reported-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
Link: https://lore.kernel.org/r/28455341-ca26-d203-8b54-792bae002251@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c