On Fri, Dec 28, 2012 at 11:42:36AM +0800, Jeff Liu wrote:
> +static int btrfs_ioctl_get_fslabel(struct file *file, void __user *arg)
> +{
> +     struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
> +     const char *label = root->fs_info->super_copy->label;
> +     size_t len = strnlen(label, BTRFS_LABEL_SIZE);
> +     int ret;
> +
> +     if (len == BTRFS_LABEL_SIZE) {
> +             len--;
> +             WARN(1, "btrfs: device label is not zero terminated, "
> +                     "it will be truncated to %zu bytes.\n", len);

This will print a stacktrace, it's not needed in this context, the
warning is enough.

                printk(KERN_WARNING "...");

> +     }
> +
> +     mutex_lock(&root->fs_info->volume_mutex);
> +     ret = copy_to_user(arg, label, len);
> +     mutex_unlock(&root->fs_info->volume_mutex);
> +
> +     return ret ? -EFAULT : 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to