From: Chao Yu <yuch...@huawei.com>

In generic/38[3456], we use quotactl(2) to check if prjquota is
enabled on the given device (src/feature -P $dev in _require_prjquota),
and quotactl(2) requires the given device is a mounted device.

So it requires dump.f2fs to list/check enabled features on a mounted
device, let's relieve to allow such operation.

Signed-off-by: Chao Yu <yuch...@huawei.com>
---
 lib/libf2fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 5ac07c1..7b65fa0 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -845,7 +845,7 @@ void get_kernel_uname_version(__u8 *version)
 #ifndef ANDROID_WINDOWS_HOST
 static int open_check_fs(char *path, int flag)
 {
-       if (c.func != FSCK || c.fix_on || c.auto_fix)
+       if (c.func != DUMP && (c.func != FSCK || c.fix_on || c.auto_fix))
                return -1;
 
        /* allow to open ro */
@@ -891,7 +891,7 @@ int get_device_info(int i)
                        return -1;
                }
 
-               if (S_ISBLK(stat_buf->st_mode) && !c.force) {
+               if (S_ISBLK(stat_buf->st_mode) && !c.force && c.func != DUMP) {
                        fd = open(dev->path, O_RDWR | O_EXCL);
                        if (fd < 0)
                                fd = open_check_fs(dev->path, O_EXCL);
-- 
2.22.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to