>On 2024/2/1 14:40, zhangxirui wrote: >> 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, >> >> Ah, yes, it needs to check whether regular file was a backfile of mounted >> loop devce, >> but it does not conflict with skip check device mount state in sparse mode. >> >> Sparse file is Android only for making userdata.img or other rw partion >> image, in this case >> i guess we will not mkfs to a backfile of mounted loop device, right? skip >> check mount state is more efficient. > >But this patch leaves a hole to mkfs backfile of loop device w/ -S option >in non-Android system, right? > >Thanks, > Ok, get it.
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
