Message ID | 20160825052101.25864-1-wangxg.fnst@cn.fujitsu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Aug 25, 2016 at 01:20:59PM +0800, Wang Xiaoguang wrote: > Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> > --- > cmds-check.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/cmds-check.c b/cmds-check.c > index 0ddfd24..1cd0421 100644 > --- a/cmds-check.c > +++ b/cmds-check.c > @@ -3737,7 +3737,6 @@ static int check_fs_root(struct btrfs_root *root, > path.slots[level] = 0; > } else { > struct btrfs_key key; > - struct btrfs_disk_key found_key; > > btrfs_disk_key_to_cpu(&key, &root_item->drop_progress); > level = root_item->drop_level; > @@ -3745,10 +3744,6 @@ static int check_fs_root(struct btrfs_root *root, > wret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); > if (wret < 0) > goto skip_walking; > - btrfs_node_key(path.nodes[level], &found_key, > - path.slots[level]); > - WARN_ON(memcmp(&found_key, &root_item->drop_progress, > - sizeof(found_key))); It's not unused, the WARN_ON is an if in disguise, ane memcmp does the check, am I missing something here? -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Aug 29, 2016 at 06:22:17PM +0200, David Sterba wrote: > On Thu, Aug 25, 2016 at 01:20:59PM +0800, Wang Xiaoguang wrote: > > Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> > > --- > > cmds-check.c | 5 ----- > > 1 file changed, 5 deletions(-) > > > > diff --git a/cmds-check.c b/cmds-check.c > > index 0ddfd24..1cd0421 100644 > > --- a/cmds-check.c > > +++ b/cmds-check.c > > @@ -3737,7 +3737,6 @@ static int check_fs_root(struct btrfs_root *root, > > path.slots[level] = 0; > > } else { > > struct btrfs_key key; > > - struct btrfs_disk_key found_key; > > > > btrfs_disk_key_to_cpu(&key, &root_item->drop_progress); > > level = root_item->drop_level; > > @@ -3745,10 +3744,6 @@ static int check_fs_root(struct btrfs_root *root, > > wret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); > > if (wret < 0) > > goto skip_walking; > > - btrfs_node_key(path.nodes[level], &found_key, > > - path.slots[level]); > > - WARN_ON(memcmp(&found_key, &root_item->drop_progress, > > - sizeof(found_key))); > > It's not unused, the WARN_ON is an if in disguise, ane memcmp does the > check, am I missing something here? So, the warning should stay, please replace it with an if and a message, unless there are other reasons to drop the check completely. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On 08/30/2016 12:22 AM, David Sterba wrote: > On Thu, Aug 25, 2016 at 01:20:59PM +0800, Wang Xiaoguang wrote: >> Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> >> --- >> cmds-check.c | 5 ----- >> 1 file changed, 5 deletions(-) >> >> diff --git a/cmds-check.c b/cmds-check.c >> index 0ddfd24..1cd0421 100644 >> --- a/cmds-check.c >> +++ b/cmds-check.c >> @@ -3737,7 +3737,6 @@ static int check_fs_root(struct btrfs_root *root, >> path.slots[level] = 0; >> } else { >> struct btrfs_key key; >> - struct btrfs_disk_key found_key; >> >> btrfs_disk_key_to_cpu(&key, &root_item->drop_progress); >> level = root_item->drop_level; >> @@ -3745,10 +3744,6 @@ static int check_fs_root(struct btrfs_root *root, >> wret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); >> if (wret < 0) >> goto skip_walking; >> - btrfs_node_key(path.nodes[level], &found_key, >> - path.slots[level]); >> - WARN_ON(memcmp(&found_key, &root_item->drop_progress, >> - sizeof(found_key))); > It's not unused, the WARN_ON is an if in disguise, ane memcmp does the > check, am I missing something here? No, you're right. I mistakenly took the memcmp() as memcpy(), sorry. Regards, Xiaoguang Wang > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/cmds-check.c b/cmds-check.c index 0ddfd24..1cd0421 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3737,7 +3737,6 @@ static int check_fs_root(struct btrfs_root *root, path.slots[level] = 0; } else { struct btrfs_key key; - struct btrfs_disk_key found_key; btrfs_disk_key_to_cpu(&key, &root_item->drop_progress); level = root_item->drop_level; @@ -3745,10 +3744,6 @@ static int check_fs_root(struct btrfs_root *root, wret = btrfs_search_slot(NULL, root, &key, &path, 0, 0); if (wret < 0) goto skip_walking; - btrfs_node_key(path.nodes[level], &found_key, - path.slots[level]); - WARN_ON(memcmp(&found_key, &root_item->drop_progress, - sizeof(found_key))); } while (1) {
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> --- cmds-check.c | 5 ----- 1 file changed, 5 deletions(-)