Re: [PATCH 1/2 v3] btrfs: label should not contain return char

2014-05-22 Thread David Sterba
On Thu, May 22, 2014 at 06:41:11PM +0800, Anand Jain wrote: > @@ -385,7 +392,8 @@ static ssize_t btrfs_label_store(struct kobject *kobj, > return PTR_ERR(trans); > > spin_lock(&root->fs_info->super_lock); > - strcpy(fs_info->super_copy->label, buf); > + strncpy(fs_info

[PATCH 1/2 v3] btrfs: label should not contain return char

2014-05-22 Thread Anand Jain
From: Anand Jain generally if you use echo "test" > /sys/fs/btrfs//label it would introduce return char at the end and it can not be part of the label. The correct command is echo -n "test" > /sys/fs/btrfs//label This patch will check for this user error Signed-off-by: Anand Jain --- v3: