On Tue, Jul 01, 2014 at 05:00:07PM +0900, Satoru Takeuchi wrote:
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -363,7 +363,8 @@ static ssize_t btrfs_label_show(struct kobject *kobj,
>                               struct kobj_attribute *a, char *buf)
>  {
>       struct btrfs_fs_info *fs_info = to_fs_info(kobj);
> -     return snprintf(buf, PAGE_SIZE, "%s\n", fs_info->super_copy->label);
> +     char *label = fs_info->super_copy->label;
> +     return snprintf(buf, PAGE_SIZE, label[0] ? "%s\n" : "%s", label);

I'd prefer "" instead of the "%s" branch, but does not matter that much,

Reviewed-by: David Sterba <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to