Btrfs-progs: allow compression property gets for read-only subvolumes
authorFilipe David Borba Manana <fdmanana@gmail.com>
Tue, 15 Apr 2014 19:47:27 +0000 (20:47 +0100)
committerDavid Sterba <dsterba@suse.cz>
Fri, 2 May 2014 15:03:21 +0000 (17:03 +0200)
commit1e6195885baa1d3aea7b75c6fb752ce293e1b936
treefc936a10d7df2fcd93c69abf20ec525cccb0bcfe
parent726bc372b9529a11c79dea75f2bcc8ef8a34d67a
Btrfs-progs: allow compression property gets for read-only subvolumes

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 opening the file with O_RDONLY mode if we're doing a property
get.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
props.c
utils.c
utils.h