On 2024/1/26 14:37, zhangxirui wrote:
In sparse mode we just read or write to a sparse file not a block device
so no need to check device mount state in sparse mode.

I guess it needs to check whether regular file was a backfile of mounted
loop device, so we can only skip block device related check?

https://lore.kernel.org/linux-f2fs-devel/[email protected]

Thanks,


Signed-off-by: zhangxirui <[email protected]>
---
  lib/libf2fs.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 2451201..5315de2 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -830,6 +830,10 @@ int f2fs_devs_are_umounted(void)
  {
        int i;
+ /*no need to check device mount state in sparse mode*/
+       if (c.sparse_mode)
+               return 0;
+
        for (i = 0; i < c.ndevs; i++)
                if (f2fs_dev_is_umounted((char *)c.devices[i].path))
                        return -1;


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to