On Fri, Sep 21, 2012 at 12:42:02PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> In case of error, the function btrfs_read_fs_root_no_name() returns
> ERR_PTR() and never returns NULL pointer. The NULL test in the return
> value check should be replaced with IS_ERR(), and remove useless
> NULL test.
Good catch. Also please update the other remaining case in
disk-io.c:open_ctree()
2587 fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
2588 if (!fs_info->fs_root)
2589 goto fail_qgroup;
2590 if (IS_ERR(fs_info->fs_root)) {
2591 err = PTR_ERR(fs_info->fs_root);
2592 goto fail_qgroup;
2593 }
> dpatch engine is used to auto generated this patch.
> (https://github.com/weiyj/dpatch)
I've played with it, looks nice, although it's full of hardcoded paths.
I'd like to run it directly from the git repo. Can you please fix that?
No patch from me, because I hadcoded my paths :)
It would be great if we can run a set of .cocci scripts that would
verify code invariants (limited to cocci capabilities, but eg. the
IS_ERR is a good example) and add new ones eventually over time.
david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html