Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729958 > unrolled thread

[PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value

Started byYunlong Song <yunlong.song@huawei.com>
First post2017-09-10 13:20 +0200
Last post2017-09-12 03:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value Yunlong Song <yunlong.song@huawei.com> - 2017-09-10 13:20 +0200
    Re: [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value Chao Yu <yuchao0@huawei.com> - 2017-09-12 03:20 +0200

#1729958 — [PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value

FromYunlong Song <yunlong.song@huawei.com>
Date2017-09-10 13:20 +0200
Subject[PATCH] f2fs-tools: fix is_set_ckpt_flags for correct bool value
Message-ID<uo8rn-2Wb-3@gated-at.bofh.it>
If flag bit to check is in 0xFFFFFF00, then the return value will be false,
this is not correct, so fix it.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fsck/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 871cffc..de03512 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -276,7 +276,7 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
 static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
 {
 	unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
-	return ckpt_flags & f;
+	return ckpt_flags & f ? 1 : 0;
 }
 
 static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
-- 
1.8.5.2

[toc] | [next] | [standalone]


#1730602

FromChao Yu <yuchao0@huawei.com>
Date2017-09-12 03:20 +0200
Message-ID<uoI1P-2P9-9@gated-at.bofh.it>
In reply to#1729958
On 2017/9/10 19:15, Yunlong Song wrote:
> If flag bit to check is in 0xFFFFFF00, then the return value will be false,
> this is not correct, so fix it.
> 
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>

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

> ---
>  fsck/f2fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fsck/f2fs.h b/fsck/f2fs.h
> index 871cffc..de03512 100644
> --- a/fsck/f2fs.h
> +++ b/fsck/f2fs.h
> @@ -276,7 +276,7 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
>  static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
>  {
>  	unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
> -	return ckpt_flags & f;
> +	return ckpt_flags & f ? 1 : 0;
>  }
>  
>  static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web