Hi Surbhi,

This patch looks good to me, unless we'd better change patch title a little as
"libf2fs: throw an ...." to indicate which part of f2fs we patched.

Anyway, please add below tag in your next version:

Reviewed-by: Chao Yu <yuc...@huawei.com>

BTW, I notice that your name of email address is cool! Very suitable for f2fs
patch submission. ;)

Thanks,

On 2019/8/1 9:26, Surbhi Palande wrote:
> From: Surbhi Palande <csur...@gmail.com>
> 
> When the -m option is specified to format a Zoned device,
> do not fall back to the non-zoned mode in case information
> about the device is not found.
> 
> Explicitly specify this error to the user.
> 
> Signed-off-by: Surbhi Palande <csur...@gmail.com>
> ---
>  lib/libf2fs.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> index 6b5badf..2ea405e 100644
> --- a/lib/libf2fs.c
> +++ b/lib/libf2fs.c
> @@ -16,6 +16,7 @@
>  #include <errno.h>
>  #include <unistd.h>
>  #include <fcntl.h>
> +#include <libgen.h>
>  #ifdef HAVE_MNTENT_H
>  #include <mntent.h>
>  #endif
> @@ -1140,7 +1141,12 @@ int f2fs_get_device_info(void)
>               c.segs_per_sec = c.zone_blocks / DEFAULT_BLOCKS_PER_SEGMENT;
>               c.secs_per_zone = 1;
>       } else {
> -             c.zoned_mode = 0;
> +             if(c.zoned_mode != 0) {
> +                     MSG(0, "\n Error: %s is not zoned (-m option)", 
> c.devices[0].path);
> +                     MSG(1, "\n /sys/block/%s/queue/zoned not found \n",
> +                                     basename(c.devices[0].path));
> +                     return -1;
> +             }
>       }
>  
>       c.segs_per_zone = c.segs_per_sec * c.secs_per_zone;
> 


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

Reply via email to