Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-24 Thread Jeff Liu
On 12/24/2012 09:46 PM, Goffredo Baroncelli wrote: > Hi Jeff, > > On 12/24/2012 09:07 AM, Jeff Liu wrote: >> On 12/22/2012 01:36 AM, Goffredo Baroncelli wrote: >>> On 12/21/2012 07:42 AM, Jeff Liu wrote: > [...] I don't think we should replace strlen() with strnlen() since it's totally w

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-24 Thread Goffredo Baroncelli
Hi Jeff, On 12/24/2012 09:07 AM, Jeff Liu wrote: > On 12/22/2012 01:36 AM, Goffredo Baroncelli wrote: >> On 12/21/2012 07:42 AM, Jeff Liu wrote: [...] >>> I don't think we should replace strlen() with strnlen() since it's >>> totally wrong if the length of label is more than BTRFS_LABEL_SIZE -1, >

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-24 Thread Jeff Liu
On 12/22/2012 01:36 AM, Goffredo Baroncelli wrote: > On 12/21/2012 07:42 AM, Jeff Liu wrote: >> Hi Goffredo, >> >> On 12/21/2012 04:18 AM, Goffredo Baroncelli wrote: >>> HI Jeff, >>> >>> On 12/20/2012 09:43 AM, Jeff Liu wrote: With the new ioctl(2) BTRFS_IOC_GET_FSLABEL we can fetch the label

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-21 Thread Goffredo Baroncelli
On 12/21/2012 07:42 AM, Jeff Liu wrote: > Hi Goffredo, > > On 12/21/2012 04:18 AM, Goffredo Baroncelli wrote: >> HI Jeff, >> >> On 12/20/2012 09:43 AM, Jeff Liu wrote: >>> With the new ioctl(2) BTRFS_IOC_GET_FSLABEL we can fetch the label of a >>> mounted file system. >>> >>> Signed-off-by: Jie L

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-21 Thread Stefan Behrens
On 12/21/2012 07:42, Jeff Liu wrote: On 12/21/2012 04:18 AM, Goffredo Baroncelli wrote: On 12/20/2012 09:43 AM, 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

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-20 Thread Jeff Liu
Hi Goffredo, On 12/21/2012 04:18 AM, Goffredo Baroncelli wrote: > HI Jeff, > > On 12/20/2012 09:43 AM, Jeff Liu wrote: >> With the new ioctl(2) BTRFS_IOC_GET_FSLABEL we can fetch the label of a >> mounted file system. >> >> Signed-off-by: Jie Liu >> Signed-off-by: Anand Jain >> Cc: Miao Xie >

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-20 Thread Goffredo Baroncelli
HI Jeff, On 12/20/2012 09:43 AM, Jeff Liu wrote: > With the new ioctl(2) BTRFS_IOC_GET_FSLABEL we can fetch the label of a > mounted file system. > > Signed-off-by: Jie Liu > Signed-off-by: Anand Jain > Cc: Miao Xie > Cc: Goffredo Baroncelli > Cc: David Sterba [...] > +static int btrfs_ioct

[RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-20 Thread Jeff Liu
With the new ioctl(2) BTRFS_IOC_GET_FSLABEL we can fetch the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Cc: Miao Xie Cc: Goffredo Baroncelli Cc: David Sterba --- fs/btrfs/ioctl.c | 15 +++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 17 in