[PATCH 1/2] Btrfs: adjust the variables indentation to TAB

2011-11-27 Thread Jeff Liu
Signed-off-by: Jie Liu --- fs/btrfs/ioctl.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4a34c47..795c415 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1689,9 +1689,9 @@ err: static noinline int btrfs_ioctl_tr

[PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode

2011-11-27 Thread Jeff Liu
For an initial dir inode, stat(1) show it links as 1, IMHO it should be 2 by default. Signed-off-by: Jie Liu --- fs/btrfs/inode.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 116ab67..92b3cb9 100644 --- a/fs/btrfs/inode.c +++

Re: [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode

2011-11-28 Thread Jeff Liu
Please ignore this patch for now, it can cause the file system corrupted and failed to mount again, sorry for the noise! -Jeff On 11/28/2011 03:47 PM, Jeff Liu wrote: > For an initial dir inode, stat(1) show it links as 1, IMHO it should be > 2 by default. > > Signed-off

Re: [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode

2011-11-29 Thread Jeff Liu
On 11/29/2011 11:48 PM, Chris Mason wrote: > On Tue, Nov 29, 2011 at 02:04:37PM +0800, Jeff Liu wrote: >> Please ignore this patch for now, it can cause the file system corrupted >> and failed to mount again, sorry for the noise! > > Directories always have a link count

[PATCH] Btrfs: return EUCLEAN rather than ENXIO once internal error has occurred for SEEK_DATA/SEEK_HOLE inquiry

2012-02-08 Thread Jeff Liu
By referring to http://linux.die.net/man/2/lseek, return ENXIO only when "offset beyond EOF" for either SEEK_DATA or SEEK_HOLE inquiry. But we return it in case of internal issue too if btrfs_get_extent_fiemap() failed due to other issues. This will confuse the user applications to be expecting

Re: [PATCH] Btrfs: return EUCLEAN rather than ENXIO once internal error has occurred for SEEK_DATA/SEEK_HOLE inquiry

2012-02-08 Thread Jeff Liu
On 02/09/2012 11:46 AM, Jeff Liu wrote: > By referring to http://linux.die.net/man/2/lseek, return ENXIO only > when "offset beyond EOF" for either SEEK_DATA or SEEK_HOLE inquiry. > But we return it in case of internal issue too if btrfs_get_extent_fiemap() > failed > d

Re: [PATCH] Btrfs: return EUCLEAN rather than ENXIO once internal error has occurred for SEEK_DATA/SEEK_HOLE inquiry

2012-02-08 Thread Jeff Liu
On 02/09/2012 12:51 PM, Dave Chinner wrote: > On Thu, Feb 09, 2012 at 12:08:47PM +0800, Jeff Liu wrote: >> On 02/09/2012 11:46 AM, Jeff Liu wrote: >> >>> By referring to http://linux.die.net/man/2/lseek, return ENXIO only >>> when "offset beyond EOF"

[PATCH v2] Btrfs: return the internal error unchanged if btrfs_get_extent_fiemap() call failed for SEEK_DATA/SEEK_HOLE inquiry

2012-02-08 Thread Jeff Liu
Given that ENXIO only means "offset beyond EOF" for either SEEK_DATA or SEEK_HOLE inquiry in a desired file range, so we should return the internal error unchanged if btrfs_get_extent_fiemap() call failed, rather than ENXIO. Cc: Dave Chinner Signed-off-by: Jie Liu --- fs/btrfs/file.c |4

[PATCH] btrfs: fix the code comments for LZO compression workspace

2013-06-06 Thread Jeff Liu
From: Jie Liu Fix the code comments for lzo compression workspace. The buf item is used to store the decompressed data and cbuf is used to store the compressed data. Signed-off-by: Jie Liu --- fs/btrfs/lzo.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/lz

[PATCH] btrfs: fix file truncation if FALLOC_FL_KEEP_SIZE is specified

2013-06-27 Thread Jeff Liu
From: Jie Liu Create a small file and fallocate it to a big size with FALLOC_FL_KEEP_SIZE option, then truncate it back to the small size again, the disk free space is not changed back in this case. i.e, # dd if=/dev/zero of=/mnt/test bs=512 count=1 # ls -l /mnt total 4 -rw-r--r-- 1 root root 51

Re: [PATCH] btrfs: fix file truncation if FALLOC_FL_KEEP_SIZE is specified

2013-06-28 Thread Jeff Liu
On 06/28/2013 08:41 PM, Josef Bacik wrote: > On Fri, Jun 28, 2013 at 01:15:52PM +0800, Jeff Liu wrote: >> From: Jie Liu >> >> Create a small file and fallocate it to a big size with >> FALLOC_FL_KEEP_SIZE option, then truncate it back to the >> small size

Re: [PATCH] btrfs: fix file truncation if FALLOC_FL_KEEP_SIZE is specified

2013-06-28 Thread Jeff Liu
On 06/29/2013 10:22 AM, Dave Chinner wrote: > On Fri, Jun 28, 2013 at 08:41:00AM -0400, Josef Bacik wrote: >> On Fri, Jun 28, 2013 at 01:15:52PM +0800, Jeff Liu wrote: >>> From: Jie Liu >>> >>> Create a small file and fallocate it to a big size with >>&

Re: [PATCH] xfstests: generic/315: allow a little tolerance for our used check

2013-07-29 Thread Jeff Liu
On 07/30/2013 02:55 AM, Josef Bacik wrote: > So df in btrfs is tricky at best, and relying on it for accurate information > is > not great, but it's the best way to verify this test. To get around btrfs > being > inconsistent sometimes just use _within_tolerance to check our new df value to > m

Re: btrfs_print_tree?

2012-07-01 Thread Jeff Liu
On 07/01/2012 05:49 PM, Zhi Yong Wu wrote: > On Sun, Jul 1, 2012 at 5:41 PM, Mike Fleetwood > wrote: >> On 1 July 2012 05:53, Zhi Yong Wu wrote: >>> HI, >>> >>> Do anyone know where btrfs_print_tree is invoked? thanks. >>> >>> -- >>> Regards, >>> >>> Zhi Yong Wu >> >> Is this the answer you are

[RFC PATCH 0/5] btrfs-progs: snapshot diff function

2012-08-07 Thread Jeff Liu
Hello, I've done a prototype implementation of snapshot diff utility many months ago. It was originally meant to analyze the differences between two snapshots which are inherited from the same subvolume/snapshot. Moreover, the upstream LXC userland tools has been released with a dedicated templ

[RFC PATCH 1/5] btrfs-progs: make ino_resovle() shared

2012-08-07 Thread Jeff Liu
Make ino_resolve() shared so that we can call it at snapshot diff module. Signed-off-by: Jie Liu --- btrfs-list.c |3 +-- btrfs-list.h | 22 ++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 btrfs-list.h diff --git a/btrfs-list.c b/btrfs-list.

[RFC PATCH 2/5] btrfs-progs: header file of snapshot diff

2012-08-07 Thread Jeff Liu
Maybe it's better to put those #defines to the source file of snapshot diff as no other modules need them. Signed-off-by: Jie Liu --- diff-snapshot.h | 47 +++ 1 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 diff-snapshot.h d

[RFC PATCH 3/5] btrfs-progs: souce file of snapshot diff

2012-08-07 Thread Jeff Liu
Now the source file is coming. Signed-off-by: Jie Liu --- diff-snapshot.c | 1026 +++ 1 files changed, 1026 insertions(+), 0 deletions(-) create mode 100644 diff-snapshot.c diff --git a/diff-snapshot.c b/diff-snapshot.c new file mode 100644

[RFC PATCH 4/5] btrfs-progs: teach Makefile aware of the new comer

2012-08-07 Thread Jeff Liu
Signed-off-by: Jie Liu --- Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 969..f8b517d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CFLAGS = -g -O0 objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \

[RFC PATCH 5/5] btrfs-progs: let this feature works at subvolume command group.

2012-08-07 Thread Jeff Liu
make this feature works as `btrfs subvolume diff-snapshot [options] `. Signed-off-by: Jie Liu --- cmds-subvolume.c | 90 ++ 1 files changed, 90 insertions(+), 0 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 3508ce6.

Re: [RFC PATCH 0/5] btrfs-progs: snapshot diff function

2012-08-24 Thread Jeff Liu
ke end user's life easier, that would be fine. Thanks, -Jeff > Apologies if I somehow misunderstood what your snapshot-diff code does. > > Thanks, > Alex. > > > On Tue, Aug 7, 2012 at 11:56 AM, Jeff Liu wrote: >> Hello, >> >> I've done a prototype

[PATCH] Btrfs: Remove the invalid shrink size check up from btrfs_shrink_dev()

2012-10-27 Thread Jeff Liu
Remove an invalid size check up from btrfs_shrink_dev(). The new size should not larger than the device->total_bytes as it was already verified before coming to here(i.e. new_size < old_size). Remove invalid check up for btrfs_shrink_dev(). Signed-off-by: Jie Liu --- fs/btrfs/ioctl.c |2

Re: How to find (out if) files sharing content?

2012-10-30 Thread Jeff Liu
On 10/31/2012 08:40 AM, Liu Bo wrote: > On 10/30/2012 11:20 PM, Gábor Nyers wrote: >> Hi, >> >> How could one find out if 2 files share any extents on a btrfs file system? >> >> A more generic variation of the above: How to list files on the same >> file system/subvolume sharing content? One idea i

Re: How to find (out if) files sharing content?

2012-10-31 Thread Jeff Liu
On 10/31/2012 07:31 PM, David Sterba wrote: > On Wed, Oct 31, 2012 at 10:30:22AM +0800, Jeff Liu wrote: >> One idea is to mark those cloned extents as FIEMAP_EXTENT_SHARED so that >> we can go through a file to figure out how many extents are shared >> through fiemap(2), a

Re: How to find (out if) files sharing content?

2012-11-05 Thread Jeff Liu
On 11/06/2012 06:45 AM, David Sterba wrote: > On Wed, Oct 31, 2012 at 09:02:15PM +0800, Jeff Liu wrote: >> I propose this because OCFS2 report shared space in this way combine with >> du(1). >> >> An old patch set to teach du(1) aware of reflinked file: >> https

[PATCH V4 1/2] Btrfs: Add a new ioctl to get the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Introduce a new ioctl BTRFS_IOC_GET_FSLABEL, which would be used to fetch the label of a mounted filesystem. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 14 ++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.

[PATCH V4 2/2] Btrfs: Add a new ioctl to change the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted filesystem. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 14 ++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8fcf

[RFC PATCH V4 0/2] Btrfs: get/set mounted filesystem label support

2012-12-11 Thread Jeff Liu
Hello, This is an improved tiny patch set to add get/set the label upon a mounted file system via ioctl(2). I'd like to add the Signed-off-by with Anand for the credit since He has posted a similar patch set a few month ago. Changes of V4->V3: - Add a new ioctl to fetch the label of a mounted

[PATCH v4 3/3] Btrfs-progs: fix cmd_label_usage to reflect this change.

2012-12-11 Thread Jeff Liu
Fix the command usage of "btrfs filesystem label" to reflect this change. i.e. so that we can get/set the label of a mounted filesystem against the mountpoint. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- cmds-filesystem.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v4 1/3] Btrfs-progs: get the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Get the label of a mounted filesystem through the new ioctl BTRFS_IOCTL_FS_GETLABEL. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- btrfslabel.c | 68 +- ioctl.h |2 ++ utils.c |2 +- utils.h |1 + 4 fi

[PATCH v4 2/3] Btrfs-progs: change the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Change the label of a mounted file system through the new ioctl BTRFS_IOCTL_FS_SETLABEL. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- btrfslabel.c | 84 ++ ioctl.h |2 ++ 2 files changed, 51 insertions(+), 35 deletions

Re: [PATCH V4 2/2] Btrfs: Add a new ioctl to change the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Hi Miao, On 12/12/2012 11:03 AM, Miao Xie wrote: > Hi, Liu > > On wed, 12 Dec 2012 08:22:28 +0800, Jeff Liu wrote: >> Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted >> filesystem. >> >> Signed-off-by: Jie Liu >> Signed-off-by: Ana

[RESEND PATCH V4 1/2] Btrfs: Add a new ioctl to get the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 14 ++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8fcf9a5..b0a5e17 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3699,6 +36

[RESEND PATCH V4 2/2] Btrfs: Add a new ioctl to change the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted filesystem. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 34 ++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 36 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btr

Re: [RESEND PATCH V4 1/2] Btrfs: Add a new ioctl to get the label of a mounted filesystem

2012-12-11 Thread Jeff Liu
On 12/12/2012 11:50 AM, Miao Xie wrote: > On Wed, 12 Dec 2012 11:22:49 +0800, Jeff Liu wrote: >> Signed-off-by: Jie Liu >> Signed-off-by: Anand Jain >> >> --- >> fs/btrfs/ioctl.c | 14 ++ >> fs/btrfs/ioctl.h |2 ++ >> 2 files ch

Re: [RESEND PATCH V4 2/2] Btrfs: Add a new ioctl to change the label of a mounted filesystem

2012-12-16 Thread Jeff Liu
Sorry for my late response, I missed your feedback somehow. On 12/12/2012 12:15 PM, Miao Xie wrote: > On wed, 12 Dec 2012 11:23:00 +0800, Jeff Liu wrote: >> Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted >> filesystem. >> >> >> Signed-off-by:

[RFC PATCH V5 0/2] Btrfs: get/set label of mounted file system

2012-12-17 Thread Jeff Liu
Hello, This patch set is trying to make Btrfs support get/set label for a mounted file sytem via ioctl(2). There are a couple of changes according to Miao's comments which were shown as following. Changes of V5->V4 in kernel: - Revise the ioctl number of BTRFS_IOC_GET_FSLABEL/BTRFS_IOC_SET_FSLA

[RFC PATCH V5 2/2] Btrfs: Add a new ioctl to change the label of a mounted file system

2012-12-17 Thread Jeff Liu
Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Cc: Miao Xie --- fs/btrfs/ioctl.c | 40 fs/btrfs/ioctl.h |2 ++ 2 files changed, 42 insertions(+) diff --

[RFC PATCH V5 1/2] Btrfs: Add a new ioctl to get the label of a mounted filesystem

2012-12-17 Thread Jeff Liu
Introduce a new ioctl BTRFS_IOC_GET_FSLABEL to fetch the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Cc: Miao Xie --- fs/btrfs/ioctl.c | 15 +++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 17 insertions(+) diff --git a/fs/btrfs/ioctl.c b/f

[PATCH v5 1/4] Btrfs-progs: get label of a mounted file system

2012-12-17 Thread Jeff Liu
With this new ioctl(2), we can get the label for a mounted file system. It still does normal process to fetch label if the specified file system is unmounted. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- btrfslabel.c | 74 ++

[PATCH V5 2/4] Btrfs-progs: Change the label of a mounted file system

2012-12-17 Thread Jeff Liu
With this new ioctl(2), we can set/change the label for a mounted file system. It still does normal process for an umounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- btrfslabel.c | 90 +++--- ioctl.h |2 ++

[PATCH V5 3/4] Btrfs-progs: Fix set_label_unmounted() with label length validation

2012-12-17 Thread Jeff Liu
Currently, we keeping silent if the label length is exceeding BTRFS_LABEL_SIZE - 1, and just truncating the characters beyond that. This patch make it return error and exit in this situation. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- btrfslabel.c | 10 -- 1 file changed,

[PATCH v5 4/4] Btrfs-progs: fix cmd_label_usage to reflect this change.

2012-12-17 Thread Jeff Liu
Fix the command usage of "btrfs filesystem label" to reflect this change. i.e. so that we can get/set the label of a mounted filesystem against the mountpoint. Signed-off-by: Jie Liu Signed-off-by: Anand Jain --- cmds-filesystem.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

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

2012-12-17 Thread Jeff Liu
On 12/17/2012 07:57 PM, Miao Xie wrote: > Onmon, 17 Dec 2012 19:22:11 +0800, Jeff Liu wrote: >> Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a mounted >> file system. >> >> Signed-off-by: Jie Liu >> Signed-off-by: Anand Jain >&g

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

2012-12-17 Thread Jeff Liu
On 12/18/2012 01:34 AM, Goffredo Baroncelli wrote: > On 12/17/2012 02:30 PM, Jeff Liu wrote: >> On 12/17/2012 07:57 PM, Miao Xie wrote: >>> On mon, 17 Dec 2012 19:22:11 +0800, Jeff Liu wrote: >>>> Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label

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

2012-12-17 Thread Jeff Liu
On 12/18/2012 10:21 AM, Miao Xie wrote: > Onmon, 17 Dec 2012 18:34:41 +0100, Goffredo Baroncelli wrote: >> On 12/17/2012 02:30 PM, Jeff Liu wrote: >>> On 12/17/2012 07:57 PM, Miao Xie wrote: >>>> On mon, 17 Dec 2012 19:22:11 +0800, Jeff Liu wrot

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

2012-12-17 Thread Jeff Liu
On 12/18/2012 10:33 AM, Jeff Liu wrote: > On 12/18/2012 10:21 AM, Miao Xie wrote: >> On mon, 17 Dec 2012 18:34:41 +0100, Goffredo Baroncelli wrote: >>> On 12/17/2012 02:30 PM, Jeff Liu wrote: >>>> On 12/17/2012 07:57 PM, Miao Xie wrote: >>>>> On

[RFC PATCH V6 0/2] Btrfs: get/set label of a mounted file system

2012-12-17 Thread Jeff Liu
Hello, Here is quick fix for btrfs set lable ioctl(2) based on v5, it does label length check up with strnlen() to avoid searching a zero could go beyond the page limit touching an un-mapped page and raising an segmentation fault with strlen(). V6->v5: - Improve the input label string validati

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

2012-12-17 Thread Jeff Liu
Introduce a new ioctl BTRFS_IOC_GET_FSLABEL to fetch the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Reviewed-by: Miao Xie --- fs/btrfs/ioctl.c | 15 +++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 17 insertions(+) diff --git a/fs/btrfs/io

[RFC PATCH V6 2/2] Btrfs: Add a new ioctl to change the label of a mounted file system

2012-12-17 Thread Jeff Liu
Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Cc: Miao Xie Cc: Goffredo Baroncelli --- fs/btrfs/ioctl.c | 39 +++ fs/btrfs/ioctl.h |2 ++ 2 files changed, 4

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

2012-12-18 Thread Jeff Liu
Hi Goffredo, Thanks for your review. On 12/19/2012 02:00 AM, Goffredo Baroncelli wrote: > Hi Jeff, > > On 12/18/2012 04:31 AM, Miao Xie wrote: > [...] >>> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c > [...] > >>> +static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) >>>

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

2012-12-20 Thread Jeff Liu
On 12/19/2012 10:21 PM, David Sterba wrote: > On Tue, Dec 18, 2012 at 11:06:07AM +0800, Jeff Liu wrote: >> +static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) >> +{ >> +struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; >&

[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

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

2012-12-20 Thread Jeff Liu
With the new ioctl(2) BTRFS_IOC_SET_FSLABEL, we can set/change 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 | 39 +++ fs/btrfs/ioctl.h |

[RFC PATCH v7 0/2] Btrfs: get/set label of a mounted file system

2012-12-20 Thread Jeff Liu
Hello, Per David's comments upon v6, I missed a check up against the return value of btrfs_end_transaction for btrfs_ioctl_fs_setlabel(), it was fixed in this version. v7->v6: - take care of btrfs_end_transaction() in btrfs_ioctl_fs_setlabel() rather than keeping silence. The old versions can

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 >> Sig

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 t

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 str

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

2012-12-27 Thread Jeff Liu
Add a new ioctl(2) BTRFS_IOC_GET_FSLABLE, so that we can get the label upon 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 | 22 ++ fs/btrfs/ioctl.h |2 ++ 2 files

[RFC PATCH v8 0/2] Btrfs: get/set label of a mounted file system

2012-12-27 Thread Jeff Liu
Hello, Here is the updated version of introduce get/set_or_change label upon a mounted filesystem. v8->v7: btrfs_ioc_fs_getlabel(): - Examine the label length with strnlen(). - Tweak up warn() info if the label is not NUL terminated according to Goffredo's suggestions. The old versions can be

[RFC PATCH v8 2/2] Btrfs: Add a new ioctl to set/change the label of a mounted file system

2012-12-27 Thread Jeff Liu
With this new ioctl(2) BTRFS_IOC_SET_FSLABEL, we can set/change the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Reviewed-by: Miao Xie Reviewed-by: Goffredo Baroncelli Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 39

Re: [RFC PATCH v8 2/2] Btrfs: Add a new ioctl to set/change the label of a mounted file system

2012-12-31 Thread Jeff Liu
On 12/28/2012 08:03 PM, David Sterba wrote: > On Fri, Dec 28, 2012 at 11:42:40AM +0800, Jeff Liu wrote: >> +static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) >> +{ >> +struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; >&

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

2013-01-04 Thread Jeff Liu
Add a new ioctl(2) BTRFS_IOC_GET_FSLABLE, so that we can get the label upon a mounted filesystem. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Cc: Miao Xie Cc: Goffredo Baroncelli Cc: David Sterba --- fs/btrfs/ioctl.c | 21 + fs/btrfs/ioctl.h |2 ++ 2 files ch

[RFC PATCH v9 2/2] Btrfs: set/change the label of a mounted file system

2013-01-04 Thread Jeff Liu
With this new ioctl(2) BTRFS_IOC_SET_FSLABEL, we can set/change the label of a mounted file system. Signed-off-by: Jie Liu Signed-off-by: Anand Jain Reviewed-by: Miao Xie Reviewed-by: Goffredo Baroncelli Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 42

[RFC PATCH v9 0/2] Btrfs: get/set label for a mounted file system

2013-01-04 Thread Jeff Liu
Hello, There have a couple of changes in this version which were shown as following: - Don't reserve an unit of transactions for set filesystem label. - Replace the old warning message to "btrfs: label is too long, return the first %zu bytes" in btrfs_ioc_get_fslabel() is the existing label l

[PATCH] Btrfs: replace simple_strtoull() with kstrtoull() in btrfs_ioctl_resize()

2013-01-05 Thread Jeff Liu
simple_strtoull() is obsolete, use kstrtoull() instead. Signed-off-by: Jie Liu --- fs/btrfs/ioctl.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8fcf9a5..b147424 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -

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

2013-01-06 Thread Jeff Liu
Hi, On 01/07/2013 02:44 AM, Goffredo Baroncelli wrote: > Hi Jeff, > > On 01/05/2013 03:48 AM, Jeff Liu wrote: >> Add a new ioctl(2) BTRFS_IOC_GET_FSLABLE, so that we can get the label upon >> a mounted filesystem. >> >> Signed-off-by: Jie Liu >> Signed-off

Re: [PATCH] Btrfs: replace simple_strtoull() with kstrtoull() in btrfs_ioctl_resize()

2013-01-07 Thread Jeff Liu
On 01/08/2013 12:03 AM, David Sterba wrote: > On Sun, Jan 06, 2013 at 11:53:41AM +0800, Jeff Liu wrote: >> -devid = simple_strtoull(devstr, &end, 10); >> +ret = kstrtoull(devstr, 10, &devid); >> +if (ret) { >> +

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

2013-01-07 Thread Jeff Liu
Hi Goffredo, On 01/08/2013 01:32 AM, Goffredo Baroncelli wrote: > Hi Jeff, > > On 01/07/2013 07:24 AM, Jeff Liu wrote: >> Hi, >> On 01/07/2013 02:44 AM, Goffredo Baroncelli wrote: >>> Hi Jeff, >>> >>> On 01/05/2013 03:48 AM, Jeff Liu wrote: >&g

[PATCH] Btrfs: fix sparse warning related to drop_delayed_ref()

2013-01-08 Thread Jeff Liu
Fix a sparse warning: fs/btrfs/delayed-ref.c:236:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] Signed-off-by: Jie Liu --- fs/btrfs/delayed-ref.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-r

[PATCH] Btrfs: remove meanlingless owner as well as it related stuff in btrfs_new_inode

2013-01-08 Thread Jeff Liu
Remove the owner variable as well as it related stuff. owner is meaningless in btrfs_new_inode() context, clean it out. Signed-off-by: Jie Liu --- fs/btrfs/inode.c |6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 95542a1..f56eae1 100644 ---

Re: [PATCH] remove "device show" from btrfs man page

2013-01-08 Thread Jeff Liu
Hi Simon, For the next time when you post btrfs-progs related patches, please indicate it with a suffix "Btrfs-progs: " on the subject. Thanks, -Jeff On 01/09/2013 02:46 PM, Simon Xu wrote: > Remove "device show" from btrfs man page as it's not supported by the > btrfs utility. > --- > man/btrfs

Re: [patch] Btrfs: fix access_ok() check in btrfs_ioctl_send()

2013-01-10 Thread Jeff Liu
On 01/10/2013 04:57 PM, Dan Carpenter wrote: > The closing parenthesis is in the wrong place. We want to check > "sizeof(*arg->clone_sources) * arg->clone_sources_count" instead of > "sizeof(*arg->clone_sources * arg->clone_sources_count)". > > Signed-off-by: Dan Carpenter > --- > This is also v

Re: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c

2013-01-28 Thread Jeff Liu
"if" >> Signed-off-by: Gene Czarcinski >> --- >> btrfslabel.c | 57 +++++ > > Jeff Liu has sent a series that updates the code and also fixes the > formatting. And I'd prefer to take his series as a more extensiv

[PATCH 0/2] btrfs-progs: btrfslabel source code consolidation

2013-01-28 Thread Jeff Liu
Hello, As per David's suggestions, we should remove btrfslabel source code and move the related functions to cmds-filesystems or utils. I prefer to move them into utils since there already has a check_label() function which can be used for the pre-checkup against the input label. This patch se

[PATCH 1/2] btrfs-progs: refactor check_label()

2013-01-28 Thread Jeff Liu
Refactor check_label(). Make it be static at first, this is a preparation step since we'll remove btrfslabel.[c|h] and move those functions at them to utils.[c|h], we can do pre-checking against the input label string with it. Also, fix the input lable length verfication from BTRFS_LABEL_SIZE to

[PATCH 2/2] btrfs-progs: remove btrfslabel.[c|h]

2013-01-28 Thread Jeff Liu
Clean btrfslabel.[c|h] out of the source tree and move those related functions to utils.[c|h]. Signed-off-by: Jie Liu CC: David Sterba CC: Gene Czarcinski --- Makefile |4 +- btrfslabel.c | 178 - btrfslabel.h |5 -

Re: [PATCH 2/2] btrfs-progs: remove btrfslabel.[c|h]

2013-01-29 Thread Jeff Liu
On 01/29/2013 06:26 PM, Stefan Behrens wrote: > On Tue, 29 Jan 2013 14:24:13 +0800, Jeff Liu wrote: >> Clean btrfslabel.[c|h] out of the source tree and move those related >> functions to utils.[c|h]. >> >> Signed-off-by: Jie Liu >> CC: David Sterba >> C

Re: [PATCH 1/2] btrfs-progs: refactor check_label()

2013-01-29 Thread Jeff Liu
On 01/29/2013 11:19 PM, David Sterba wrote: > On Tue, Jan 29, 2013 at 02:24:12PM +0800, Jeff Liu wrote: >> --- a/utils.c >> +++ b/utils.c >> @@ -1122,17 +1122,21 @@ char *pretty_sizes(u64 size) >>-1if the label is too long >>-2if the la

[PATCH v2 1/2] btrfs-progs: refactor check_label()

2013-01-30 Thread Jeff Liu
Refactor check_label(). - Make it be static at first, this is a preparation step since we'll remove btrfslabel.[c|h] and move those functions from there to utils.[c|h], we can do pre-checking against the input label string with it. - Fix the label length check up from BTRFS_LABEL_SIZE to BTRFS_LAB

[PATCH v2 2/2] btrfs-progs: move btrfslabel.[c|h] stuff to utils.[c|h]

2013-01-30 Thread Jeff Liu
Clean btrfslabel.[c|h] out of the source tree and move those related functions to utils.[c|h]. Signed-off-by: Jie Liu CC: David Sterba CC: Gene Czarcinski --- Makefile |4 +- btrfslabel.c | 178 - btrfslabel.h |5

[PATCH 16/24] btrfs: return actual error on btrfs_init_sysfs

2014-06-17 Thread Jeff Liu
From: Jie Liu Return the actual error code if call kset_create_and_add() failed Cc: Chris Mason Cc: Josef Bacik Signed-off-by: Jie Liu --- fs/btrfs/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index df39458..8f7dfa7 10064

Re: [PATCH 16/24] btrfs: return actual error on btrfs_init_sysfs

2014-06-17 Thread Jeff Liu
Hi, On 06/17/2014 22:32 PM, Jeff Liu wrote: > From: Jie Liu > > Return the actual error code if call kset_create_and_add() failed > > Cc: Chris Mason > Cc: Josef Bacik > Signed-off-by: Jie Liu Please ignore this patch because Greg think that is incorrect. Cheers, -J

Re: bug#8061: Introduce SEEK_DATA/SEEK_HOLE to extent_scan module

2011-08-26 Thread Jeff Liu
/* Extent information: a malloc'd array of ei_count structs. */ struct extent_info *ext_info; }; -void extent_scan_init (int src_fd, struct extent_scan *scan); +bool extent_scan_init (int src_fd, size_t src_total_size, + struct extent_scan *scan); bool extent_scan_read (s

don't fetch the inode size beforehand.

2011-08-26 Thread Jeff Liu
Hello, I think we don't need to fetch the inode size in advance. :-P. diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index e7872e4..f8ad957 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1698,7 +1698,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)

Fix btrfs_file_llseek() to return -EINVAL directly

2011-08-29 Thread Jeff Liu
Hello, In btrfs_file_llseek(), if the offset < 0 or offset > inode->i_sb->s_maxbytes, we should return -EINVAL rather than offset. Also, if the offset >= inode->i_size for SEEK_DATA or SEEK_HOLE, return -ENXIO is ok IMHO. Signed-off-by: Jie Liu diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c

trivial fix s/u64/u32/ for sb->s_blocksize

2011-08-29 Thread Jeff Liu
Hello, in btrfs_ioctl_clone(), using u32 for super_block->s_blocksize assignment. Signed-off-by: Jie Liu diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 970977a..03ab77a 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2133,12 +2133,12 @@ static noinline long btrfs_ioctl_clone(s

Re: Fix btrfs_file_llseek() to return -EINVAL directly

2011-08-29 Thread Jeff Liu
mp;& !(file->f_mode & FMODE_UNSIGNED_OFFSET)) { -ret = -EINVAL; +offset = -EINVAL; goto out; } if (offset > inode->i_sb->s_maxbytes) { -ret = -EINVAL; +offset = -EINVAL; goto out; } -- 1.7.4.1 On 08/29/2011 05:48 PM, Jef

[PATCH] Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs buffer overflow

2011-08-30 Thread Jeff Liu
Hello, While going through the mkfs.c, I noticed there is an issue for label length checking, mkfs.btrfs will crashed if the label length exceeding 255 bytes, it's easy to triggered that out as below: jeff@pibroch:~/opensource/btrfs-progs$ sudo ./mkfs.btrfs -L `perl -e 'print "A"x256'` /usr/

[PATCH] Btrfs: added new ioctl to set fs label

2011-09-01 Thread Jeff Liu
Hello, I'd like to introduce a new ioctl to set file system label. With this feature, we can execute `btrfs filesystem label [label] [path]` through btrfs tools to set or change the label. Signed-off-by: Jie Liu --- fs/btrfs/ctree.h |6 ++ fs/btrfs/ioctl.c | 37 ++

[PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support

2011-09-01 Thread Jeff Liu
Hello, This patch make use of the new ioctl(2) to set Btrfs label via `btrfs filesystem label` command. Signed-off-by: Jie Liu --- btrfs.c |7 +++ btrfs_cmds.c | 27 +++ btrfs_cmds.h |1 + ctree.h |6 ++ ioctl.h |2 ++ mkfs.c

Re: [PATCH] Btrfs: added new ioctl to set fs label

2011-09-01 Thread Jeff Liu
Hi Hugo, On 09/01/2011 05:00 PM, Hugo Mills wrote: On Thu, Sep 01, 2011 at 04:47:47PM +0800, Jeff Liu wrote: Hello, I'd like to introduce a new ioctl to set file system label. With this feature, we can execute `btrfs filesystem label [label] [path]` through btrfs tools to set or chang

[PATCH] Btrfs: added new ioctl to set fs label V2

2011-09-01 Thread Jeff Liu
- 1.7.4.1 On 09/01/2011 05:32 PM, Hugo Mills wrote: On Thu, Sep 01, 2011 at 05:18:38PM +0800, Jeff Liu wrote: Hi Hugo, On 09/01/2011 05:00 PM, Hugo Mills wrote: On Thu, Sep 01, 2011 at 04:47:47PM +0800, Jeff Liu wrote: Hello, I'd like to introduce a new ioctl to set file system label. Wi

[PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support V2

2011-09-01 Thread Jeff Liu
#x27;\\') { +fprintf(stderr, "invalid label %s\n", input); +exit(1); +} +} +return strdup(input); +} diff --git a/utils.h b/utils.h index 9dce5b0..9212a75 100644 --- a/utils.h +++ b/utils.h @@ -40,4 +40,5 @@ int check_mounted(const char *devicenam

Re: [PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support V2

2011-09-02 Thread Jeff Liu
07:52:54PM +0800, Jeff Liu wrote: Revise the patch according to kernel side change. Leave original commit message. If you want to document changes between revised patch version put them ... ok, fixed as below: From e2990b69ecd3bac8da8023a64c866d16c81a1679 Mon Sep 17 00:00:00 2001 From: Jie Liu

Re: [PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support V2

2011-09-02 Thread Jeff liu
在 2011-9-2,下午11:48, David Sterba 写道: > On Fri, Sep 02, 2011 at 09:13:34PM +0800, Jeff Liu wrote: >> --- a/ioctl.h >> +++ b/ioctl.h >> @@ -140,6 +140,8 @@ struct btrfs_ioctl_space_args { >>struct btrfs_ioctl_vol_args) >> #define BTRFS_IOC_S

Re: [PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support V2

2011-09-04 Thread Jeff Liu
On 09/05/2011 01:03 AM, Hugo Mills wrote: On Sat, Sep 03, 2011 at 11:11:36AM +0800, Jeff liu wrote: 在 2011-9-2,下午11:48, David Sterba 写道: On Fri, Sep 02, 2011 at 09:13:34PM +0800, Jeff Liu wrote: --- a/ioctl.h +++ b/ioctl.h @@ -140,6 +140,8 @@ struct btrfs_ioctl_space_args

[PATCH] Btrfs: added new ioctl to set fs label V3

2011-09-05 Thread Jeff Liu
Hello, According to Hugo and David's advise, the ioctl number of BTRFS_IOC_FS_SETLABEL ioctl was changed to 50 now. Signed-off-by: Jie Liu --- fs/btrfs/ctree.h |4 fs/btrfs/ioctl.c | 36 fs/btrfs/ioctl.h |2 ++ 3 files changed, 42 insertio

[PATCH] Btrfs-progs: added btrfs filesystem label [label] [path] support V3

2011-09-05 Thread Jeff Liu
exit(1); +} +} +return strdup(input); +} diff --git a/utils.h b/utils.h index 9dce5b0..9212a75 100644 --- a/utils.h +++ b/utils.h @@ -40,4 +40,5 @@ int check_mounted(const char *devicename); int btrfs_device_already_in_root(struct btrfs_root *root, int fd, int

mount a multi-device filesystem using a loopback device

2011-09-06 Thread Jeff Liu
Hello, I was trying to create a multi-device Btrfs filesystem using two loopback devices, by referring to the following page: https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices However, I met a strange thing while mounting the first loop device without any extra mount o

  1   2   >