[PATCH] btrfs-progs: allow "no" to disable compression for convenience

2017-09-16 Thread Satoru Takeuchi
It's messy to use "" to disable compression. Introduce the new value "no" which can also be used for this purpose. Signed-off-by: Satoru Takeuchi --- Documentation/btrfs-property.asciidoc | 2 +- props.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-)

Re: subvolume list as user?

2017-09-16 Thread Goffredo Baroncelli
On 09/16/2017 04:37 PM, Ulli Horlacher wrote: > On Sat 2017-09-16 (14:39), Hans van Kranenburg wrote: >> On 09/16/2017 11:45 AM, Ulli Horlacher wrote: >> >>> Every user can create subvolumes (and root cannot prevent it!). >>> But how can a user list these subvolumes? >>> >>> tux@xerus:/test/tux: bt

Re: subvolume list as user?

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (14:39), Hans van Kranenburg wrote: > On 09/16/2017 11:45 AM, Ulli Horlacher wrote: > > > Every user can create subvolumes (and root cannot prevent it!). > > But how can a user list these subvolumes? > > > > tux@xerus:/test/tux: btrfs subvolume create test > > Create subvolume '

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (13:47), Kai Krakow wrote: > Or you do "btrfs device stats .", it shows the associated device(s). tux@xerus:/test/tux/zz: btrfs device stats . ERROR: getting dev info for devstats failed: Operation not permitted Not possible for a normal user. -- Ullrich Horlacher

Re: subvolume list as user?

2017-09-16 Thread Hans van Kranenburg
On 09/16/2017 02:39 PM, Hans van Kranenburg wrote: > On 09/16/2017 11:45 AM, Ulli Horlacher wrote: >> Every user can create subvolumes (and root cannot prevent it!). >> But how can a user list these subvolumes? >> >> tux@xerus:/test/tux: btrfs subvolume create test >> Create subvolume './test' > >

Re: Regarding handling of file renames in Btrfs

2017-09-16 Thread Hans van Kranenburg
On 09/16/2017 02:40 PM, Martin Raiber wrote: > Hi, > > On 16.09.2017 14:27 Hans van Kranenburg wrote: >> On 09/10/2017 01:50 AM, Rohan Kadekodi wrote: >>> I was trying to understand how file renames are handled in Btrfs. I >>> read the code documentation, but had a problem understanding a few >>>

Re: Regarding handling of file renames in Btrfs

2017-09-16 Thread Martin Raiber
Hi, On 16.09.2017 14:27 Hans van Kranenburg wrote: > On 09/10/2017 01:50 AM, Rohan Kadekodi wrote: >> I was trying to understand how file renames are handled in Btrfs. I >> read the code documentation, but had a problem understanding a few >> things. >> >> During a file rename, btrfs_commit_transa

Re: subvolume list as user?

2017-09-16 Thread Hans van Kranenburg
On 09/16/2017 11:45 AM, Ulli Horlacher wrote: > Every user can create subvolumes (and root cannot prevent it!). > But how can a user list these subvolumes? > > tux@xerus:/test/tux: btrfs subvolume create test > Create subvolume './test' >From your other posts I don't quickly get if you actually d

Re: Regarding handling of file renames in Btrfs

2017-09-16 Thread Hans van Kranenburg
Hi, On 09/10/2017 01:50 AM, Rohan Kadekodi wrote: > > I was trying to understand how file renames are handled in Btrfs. I > read the code documentation, but had a problem understanding a few > things. > > During a file rename, btrfs_commit_transaction() is called which is > because Btrfs has to

Re: [PATCH] Btrfs: fix unexpected result when dio reading corrupted blocks

2017-09-16 Thread Goffredo Baroncelli
On 09/15/2017 11:06 PM, Liu Bo wrote: > commit 4246a0b63bd8 ("block: add a bi_error field to struct bio") > changed the logic of how dio read endio reports errors. > > For single stripe dio read, %bio->bi_status reflects the error before > verifying checksum, and now we're updating it when data bl

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Kai Krakow
Am Sat, 16 Sep 2017 13:43:23 +0300 schrieb Marat Khalili : > On 16/09/17 13:19, Ulli Horlacher wrote: > > How do I know the btrfs filesystem for a given subvolume? > > Do I really have to manually test the diretory path upwards? > > It was discussed recently: the answer is, unfortunately, yes,

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Kai Krakow
Am Sat, 16 Sep 2017 09:36:33 +0200 schrieb Ulli Horlacher : > On Sat 2017-09-16 (01:22), Kai Krakow wrote: > > > > tux@xerus:/test/tux/zz/.snapshot: btrfs subvolume delete > > > 2017-09-15_1859.test Delete subvolume (no-commit): > > > '/test/tux/zz/.snapshot/2017-09-15_1859.test' ERROR: cannot de

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Marat Khalili
On 16/09/17 13:19, Ulli Horlacher wrote: How do I know the btrfs filesystem for a given subvolume? Do I really have to manually test the diretory path upwards? It was discussed recently: the answer is, unfortunately, yes, until someone patches df to do it for us. You can do it more or less ef

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (10:10), Goffredo Baroncelli wrote: > On 09/15/2017 06:37 PM, Ulli Horlacher wrote: > > I have my btrfs filesystem mounted with option user_subvol_rm_allowed > > You should change the "ro" property to false before deleting it > > btrfs property set /test/tux/zz/.snapshot/

subvolume list as user?

2017-09-16 Thread Ulli Horlacher
Every user can create subvolumes (and root cannot prevent it!). But how can a user list these subvolumes? tux@xerus:/test/tux: btrfs subvolume create test Create subvolume './test' tux@xerus:/test/tux: btrfs subvolume list . ERROR: can't perform the search - Operation not permitted -- Ullrich

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (11:04), Goffredo Baroncelli wrote: > In the past I proposed to allow an ordinary user to remove an *empty* > subvolume with a simple rmdir (if he has the permissions). This would solve > this kind of problem. > or to relax the check around "btrfs sub del", so an user can remov

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Peter Grandi
[ ... ] > I can delete normal subvolumes but not the readonly snapshots: It is because of ordinary permissions for both subvolumes and snapshots: tree$ btrfs sub create /fs/sda7/sub Create subvolume '/fs/sda7/sub' tree$ chmod a-w /fs/sda7/sub tree$ btrfs sub del /fs/sda7/sub Delete

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Goffredo Baroncelli
On 09/16/2017 01:22 AM, Kai Krakow wrote: > Am Sat, 16 Sep 2017 00:02:01 +0200 > schrieb Ulli Horlacher : > >> On Fri 2017-09-15 (23:44), Ulli Horlacher wrote: [...] > > See "man mount" in section btrfs mount options: There is a mount option > to allow normal user to delete snapshots. But this is

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (10:10), Goffredo Baroncelli wrote: > > tux@xerus: btrfs subvolume snapshot -r /test/tux/zz > > /test/tux/zz/.snapshot/2017-09-15_1824.test > > tux@xerus: btrfs subvolume delete > > /test/tux/zz/.snapshot/2017-09-15_1824.test > > Delete subvolume (no-commit): '/test/tux/zz/.sna

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Goffredo Baroncelli
On 09/15/2017 06:37 PM, Ulli Horlacher wrote: > I have my btrfs filesystem mounted with option user_subvol_rm_allowed > > tux@xerus: btrfs --version > btrfs-progs v4.4 > > tux@xerus: uname -a > Linux xerus 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 > x86_64 x86_64 x86_64 GNU/L

Re: A user cannot remove his readonly snapshots?!

2017-09-16 Thread Ulli Horlacher
On Sat 2017-09-16 (01:22), Kai Krakow wrote: > > tux@xerus:/test/tux/zz/.snapshot: btrfs subvolume delete > > 2017-09-15_1859.test Delete subvolume (no-commit): > > '/test/tux/zz/.snapshot/2017-09-15_1859.test' ERROR: cannot delete > > '/test/tux/zz/.snapshot/2017-09-15_1859.test': Read-only file