fsck.f2fs: don't finish zones if it's not open
PATCH 1/1 fsck.f2fs: don't finish zones if it's not open
Should finish zones if they are open.
--- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)
include/f2fs_fs.h +2 -0
@@ -1742,6 +1742,8 @@ blk_zone_cond_str(struct blk_zone *blkz)* Handle kernel zone capacity support */ #define blk_zone_empty (z) (blk_zone_cond(z) == BLK_ZONE_COND_EMPTY) +#define blk_zone_open (z) (blk_zone_cond(z) == BLK_ZONE_COND_IMP_OPEN || \ + blk_zone_cond(z) == BLK_ZONE_COND_EXP_OPEN)#define blk_zone_sector (z) (z)->start#define blk_zone_length (z) (z)->len#define blk_zone_wp_sector (z) (z)->wp
lib/libf2fs_zoned.c +3 -2
@@ -513,7 +513,7 @@ int f2fs_finish_zone(int i, void *blkzone)struct blk_zone_range range;int ret; -if (!blk_zone_seq (blkz) ||blk_zone_empty (blkz)) +if (!blk_zone_seq (blkz) || !blk_zone_open (blkz))return 0 ;/* Non empty sequential zone: finish */
@@ -522,7 +522,8 @@ int f2fs_finish_zone(int i, void *blkzone) ret =ioctl (dev->fd,BLKFINISHZONE , &range);if (ret !=0 ) { ret = -errno; -ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d\n" , errno); +ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d, status=%s\n" , + errno,blk_zone_cond_str (blkz)); }return ret;
Signature · 8 lines
2.46.0.76.ge559c4bf1a-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 27 lines · Jaegeuk Kim
Should finish zones if they are open.
Signed-off-by Jaegeuk Kim <[email protected]>--- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)include/f2fs_fs.h +2
-0@@ -1742,6 +1742,8 @@ blk_zone_cond_str(struct blk_zone *blkz)* Handle kernel zone capacity support */ #define blk_zone_empty (z) (blk_zone_cond(z) == BLK_ZONE_COND_EMPTY) +#define blk_zone_open (z) (blk_zone_cond(z) == BLK_ZONE_COND_IMP_OPEN || \ + blk_zone_cond(z) == BLK_ZONE_COND_EXP_OPEN)#define blk_zone_sector (z) (z)->start#define blk_zone_length (z) (z)->len#define blk_zone_wp_sector (z) (z)->wplib/libf2fs_zoned.c +0
-0
lib/libf2fs_zoned.c int f2fs_finish_zone(int i, void *blkzone) · line 516
Quoted 5 lines
lib/libf2fs_zoned.c +1
-1@@ -513,7 +513,7 @@ int f2fs_finish_zone(int i, void *blkzone)struct blk_zone_range range;int ret; -if (!blk_zone_seq (blkz) ||blk_zone_empty (blkz)) +if (!blk_zone_seq (blkz) || !blk_zone_open (blkz))
Don't we need to check blk_zone_empty() anymore?
Quoted 18 lines
lib/libf2fs_zoned.c +2
-2return 0 ;/* Non empty sequential zone: finish */ @@ -522,7 +522,8 @@ int f2fs_finish_zone(int i, void *blkzone) ret =ioctl (dev->fd,BLKFINISHZONE , &range);if (ret !=0 ) { ret = -errno; -ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d\n" , errno); +ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d, status=%s\n" , + errno,blk_zone_cond_str (blkz)); }return ret; --2.46.0.76.ge559c4bf1a-goog
Quoted 4 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 31 lines · Daeho Jeong
Quoted 30 lines · Jaegeuk Kim
Should finish zones if they are open.
Signed-off-by Jaegeuk Kim <[email protected]>--- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)include/f2fs_fs.h +2
-0@@ -1742,6 +1742,8 @@ blk_zone_cond_str(struct blk_zone *blkz)* Handle kernel zone capacity support */ #define blk_zone_empty (z) (blk_zone_cond(z) == BLK_ZONE_COND_EMPTY) +#define blk_zone_open (z) (blk_zone_cond(z) == BLK_ZONE_COND_IMP_OPEN || \ + blk_zone_cond(z) == BLK_ZONE_COND_EXP_OPEN)#define blk_zone_sector (z) (z)->start#define blk_zone_length (z) (z)->len#define blk_zone_wp_sector (z) (z)->wplib/libf2fs_zoned.c +0
-0@@ -513,7 +513,7 @@ int f2fs_finish_zone(int i, void *blkzone)struct blk_zone_range range;int ret;
Quoted 4 lines
lib/libf2fs_zoned.c int f2fs_finish_zone(int i, void *blkzone) · line 516
Quoted 2 lines
lib/libf2fs_zoned.c +1
-1-if (!blk_zone_seq (blkz) ||blk_zone_empty (blkz)) +if (!blk_zone_seq (blkz) || !blk_zone_open (blkz))Don't we need to check
blk_zone_empty()anymore?
I think the purpose of finishing a zone is to close any open zones. I expect the empty|full zone will be reset by f2fs later before use.
Quoted 19 lines
Quoted 19 lines
lib/libf2fs_zoned.c +2
-2return 0 ;/* Non empty sequential zone: finish */ @@ -522,7 +522,8 @@ int f2fs_finish_zone(int i, void *blkzone) ret =ioctl (dev->fd,BLKFINISHZONE , &range);if (ret !=0 ) { ret = -errno; -ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d\n" , errno); +ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d, status=%s\n" , + errno,blk_zone_cond_str (blkz)); }return ret; --2.46.0.76.ge559c4bf1a-goog
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Daeho Jeong
Reviewed-byQuoted 33 lines · Jaegeuk Kim
Quoted 31 lines · Daeho Jeong
Quoted 30 lines · Jaegeuk Kim
Should finish zones if they are open.
Signed-off-by Jaegeuk Kim <[email protected]>--- include/f2fs_fs.h | 2 ++ lib/libf2fs_zoned.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)include/f2fs_fs.h +2
-0@@ -1742,6 +1742,8 @@ blk_zone_cond_str(struct blk_zone *blkz)* Handle kernel zone capacity support */ #define blk_zone_empty (z) (blk_zone_cond(z) == BLK_ZONE_COND_EMPTY) +#define blk_zone_open (z) (blk_zone_cond(z) == BLK_ZONE_COND_IMP_OPEN || \ + blk_zone_cond(z) == BLK_ZONE_COND_EXP_OPEN)#define blk_zone_sector (z) (z)->start#define blk_zone_length (z) (z)->len#define blk_zone_wp_sector (z) (z)->wplib/libf2fs_zoned.c +0
-0@@ -513,7 +513,7 @@ int f2fs_finish_zone(int i, void *blkzone)struct blk_zone_range range;int ret;
Quoted 7 lines
Quoted 4 lines
lib/libf2fs_zoned.c int f2fs_finish_zone(int i, void *blkzone) · line 516
Quoted 2 lines
lib/libf2fs_zoned.c +1
-1-if (!blk_zone_seq (blkz) ||blk_zone_empty (blkz)) +if (!blk_zone_seq (blkz) || !blk_zone_open (blkz))Don't we need to check
blk_zone_empty()anymore?I think the purpose of finishing a zone is to close any open zones. I expect the empty|full zone will be reset by f2fs later before use.
makes sense.
Thanks,
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
lib/libf2fs_zoned.c +2
-2return 0 ;/* Non empty sequential zone: finish */ @@ -522,7 +522,8 @@ int f2fs_finish_zone(int i, void *blkzone) ret =ioctl (dev->fd,BLKFINISHZONE , &range);if (ret !=0 ) { ret = -errno; -ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d\n" , errno); +ERR_MSG ("ioctl BLKFINISHZONE failed: errno=%d, status=%s\n" , + errno,blk_zone_cond_str (blkz)); }return ret; --2.46.0.76.ge559c4bf1a-goog
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 3 lines · Jaegeuk Kim
Should finish zones if they are open.
Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel