Re: [PATCH] Btrfs-progs: allow compression property gets for read-only subvolumes

2014-04-25 Thread Liu Bo
On Tue, Apr 15, 2014 at 08:47:27PM +0100, Filipe David Borba Manana wrote: Because the function open_file_or_dir() always opened the input file in read/write mode (O_RDWR), we were not able to due a compression property get against a file living in a read-only subvolume/snapshot. Fix this by

Re: [PATCH 1/5] Add support for read-only subvolumes.

2011-04-26 Thread Li Zefan
+subvol = argv[optind+1]; +dst = argv[optind+2]; +struct btrfs_ioctl_vol_args_v2 args; Does the standard C allow to define a variable in the middle in a function instead of in the begin ? Anyway, even not required, I suggest to fill args by zero. + memset(args, 0,

[PATCH 2/5] Add support for read-only subvolumes.

2011-04-26 Thread Andreas Philipp
Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp philipp.andr...@gmail.com --- btrfs_cmds.c | 48 1 files changed, 40 insertions(+), 8

[PATCH 1/5] Add support for read-only subvolumes.

2011-04-25 Thread Andreas Philipp
Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp philipp.andr...@gmail.com --- btrfs_cmds.c | 44 1 files changed, 36 insertions(+), 8

Re: [PATCH 1/5] Add support for read-only subvolumes.

2011-04-25 Thread Goffredo Baroncelli
Hi Andreas, On 04/25/2011 03:47 PM, Andreas Philipp wrote: Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp philipp.andr...@gmail.com --- btrfs_cmds.c | 44

Re: [PATCH 1/5] Add support for read-only subvolumes.

2011-04-25 Thread Chris Mason
Excerpts from Goffredo Baroncelli's message of 2011-04-25 17:34:46 -0400: Hi Andreas, On 04/25/2011 03:47 PM, Andreas Philipp wrote: Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp

Re: [PATCH 1/5] Add support for read-only subvolumes.

2011-04-25 Thread Li Zefan
Andreas Philipp wrote: Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp philipp.andr...@gmail.com --- btrfs_cmds.c | 44 1 files changed,

Re: [PATCH 1/5] Add support for read-only subvolumes.

2011-04-25 Thread Li Zefan
+ while(1) { + int c = getopt(argc, argv, r); + if (c 0) + break; + switch(c) { + case 'r': + optind++; + readonly = 1; +

[PATCH 1/5] Add support for read-only subvolumes.

2011-04-13 Thread Andreas Philipp
Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp philipp.andr...@gmail.com --- btrfs_cmds.c | 44 1 files changed, 36 insertions(+), 8

Re: read-only subvolumes?

2011-03-24 Thread Li Zefan
When I am creating subvolumes I get this strange behavior. If I create a subvolume with a name longer than 4 characters it is read-only, if the name is shorter than 5 characters the subvolume is writeable as expected. I think it is since I upgraded to kernel version 2.6.38 (I do not create

Re: read-only subvolumes?

2011-03-24 Thread Li Zefan
IMHO, this is related to how the debug options of the kernel are configured. Attached you find two config files, both for kernel version 2.6.38, with the one named 2.6.38-debug everything works and with the other one newly created subvolumes are read only. I've figured out what's wrong.

read-only subvolumes?

2011-03-23 Thread Andreas Philipp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, When I am creating subvolumes I get this strange behavior. If I create a subvolume with a name longer than 4 characters it is read-only, if the name is shorter than 5 characters the subvolume is writeable as expected. I think it is since I

Re: read-only subvolumes?

2011-03-23 Thread Fajar A. Nugraha
On Wed, Mar 23, 2011 at 3:21 PM, Andreas Philipp philipp.andr...@gmail.com wrote: I think it is since I upgraded to kernel version 2.6.38 (I do not create subvolumes on a regular basis.). thor btrfs # btrfs subvolume create 123456789 Create subvolume './123456789' thor btrfs # touch

Re: read-only subvolumes?

2011-03-23 Thread Li Zefan
Hi all, When I am creating subvolumes I get this strange behavior. If I create a subvolume with a name longer than 4 characters it is read-only, if the name is shorter than 5 characters the subvolume is writeable as expected. I think it is since I upgraded to kernel version 2.6.38 (I do

Re: read-only subvolumes?

2011-03-23 Thread Andreas Philipp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23.03.2011 10:25, Li Zefan wrote: Hi all, When I am creating subvolumes I get this strange behavior. If I create a subvolume with a name longer than 4 characters it is read-only, if the name is shorter than 5 characters the subvolume is

Re: read-only subvolumes?

2011-03-23 Thread Andreas Philipp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23.03.2011 11:07, Andreas Philipp wrote: On 23.03.2011 10:25, Li Zefan wrote: Hi all, When I am creating subvolumes I get this strange behavior. If I create a subvolume with a name longer than 4 characters it is read-only, if the name is