Re: [PATCH v2 14/27] libbtrfsutil: add btrfs_util_deleted_subvolumes()

2018-02-23 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 11:12:56AM +0900, Misono, Tomohiro wrote: > > On 2018/02/16 4:04, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Signed-off-by: Omar Sandoval > > --- > > libbtrfsutil/btrfsutil.h| 21 +++ > >

Re: [PATCH v2 16/27] btrfs-progs: use libbtrfsutil for read-only property

2018-02-23 Thread Omar Sandoval
On Thu, Feb 22, 2018 at 01:23:45PM +0900, Misono, Tomohiro wrote: > > > On 2018/02/16 4:05, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Signed-off-by: Omar Sandoval > > --- > > messages.h | 13 > > props.c| 69 > >

Re: [PATCH v2 23/27] btrfs-progs: use libbtrfsutil for subvol sync

2018-02-23 Thread Omar Sandoval
On Thu, Feb 22, 2018 at 11:03:05AM +0900, Misono, Tomohiro wrote: > > > On 2018/02/16 4:05, Omar Sandoval wrote: > > From: Omar Sandoval > > > > btrfs_util_f_deleted_subvolumes() replaces enumerate_dead_subvols() and > > btrfs_util_f_subvolume_info() replaces

Re: [PATCH] Fix NULL pointer exception in find_bio_stripe()

2018-02-23 Thread David Sterba
On Fri, Feb 16, 2018 at 07:51:38PM +, Dmitriy Gorokh wrote: > On detaching of a disk which is a part of a RAID6 filesystem, the following > kernel OOPS may happen: > > [63122.680461] BTRFS error (device sdo): bdev /dev/sdo errs: wr 0, rd 0, > flush 1, corrupt 0, gen 0 > [63122.719584]

Re: [PATCH] btrfs: Remove redundant memory barriers

2018-02-23 Thread David Sterba
On Wed, Feb 14, 2018 at 10:53:36AM +0200, Nikolay Borisov wrote: > Using any kind of memory barriers around atomic operations which have > a return value is redundant, since those operations themselves are > fully ordered. atomic_t.txt states: > > - RMW operations that have a return value are

Re: [PATCH v2 10/27] libbtrfsutil: add btrfs_util_[gs]et_default_subvolume()

2018-02-23 Thread Omar Sandoval
On Thu, Feb 22, 2018 at 10:55:48AM +0900, Misono, Tomohiro wrote: > On 2018/02/16 4:04, Omar Sandoval wrote: > > From: Omar Sandoval > > > > set_default_subvolume() is a trivial ioctl(), but there's no ioctl() for > > get_default_subvolume(), so we need to search the root tree. >

Re: [PATCH 2/2] btrfs: drop optimal argument from find_live_mirror()

2018-02-23 Thread David Sterba
On Tue, Jan 30, 2018 at 02:28:31PM +0800, Anand Jain wrote: > Drop optimal argument from the function find_live_mirror() > as we can deduce it in the function itself. Yeah the argument is not necessary. It's another misleading variable name, as it's not 'optimal' but a fallback. Please rename it.

Re: [PATCH v2 06/27] libbtrfsutil: add btrfs_util_create_subvolume()

2018-02-23 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 05:24:04PM +0900, Misono, Tomohiro wrote: > On 2018/02/16 4:04, Omar Sandoval wrote: > > From: Omar Sandoval > > > +static enum btrfs_util_error openat_parent_and_name(int dirfd, const char > > *path, > > +

Re: [PATCH 1/1] btrfs: fix NPD when target device is missing

2018-02-23 Thread David Sterba
On Tue, Feb 20, 2018 at 10:46:25PM +0800, Anand Jain wrote: > The replace target device can be missing in which case we don't > allocate a missing btrfs_device when mounted with the -o degraded. > So check the device before access. > > BUG: unable to handle kernel NULL pointer dereference at

Re: [PATCH 1/1] btrfs: remove assert in btrfs_init_dev_replace_tgtdev()

2018-02-23 Thread David Sterba
On Tue, Feb 20, 2018 at 10:50:36PM +0800, Anand Jain wrote: > In the same function we just ran btrfs_alloc_device() which means the > btrfs_device::resized_list is sure to be empty and we are protected > with the btrfs_fs_info::volume_mutex. > > Signed-off-by: Anand Jain

Re: [PATCH v2 23/27] btrfs-progs: use libbtrfsutil for subvol sync

2018-02-23 Thread David Sterba
On Fri, Feb 23, 2018 at 02:41:27PM -0800, Omar Sandoval wrote: > > > static int cmd_subvol_sync(int argc, char **argv) > > > { > > > int fd = -1; > > > - int i; > > > int ret = 1; > > > DIR *dirstream = NULL; > > > - u64 *ids = NULL; > > > - int id_count; > > > + uint64_t *ids; > > > >

Re: [PATCH v2 07/27] libbtrfsutil: add btrfs_util_subvolume_path()

2018-02-23 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 03:27:52PM +0900, Misono, Tomohiro wrote: > On 2018/02/16 4:04, Omar Sandoval wrote: > > From: Omar Sandoval > > > +PUBLIC enum btrfs_util_error btrfs_util_subvolume_path_fd(int fd, uint64_t > > id, > > +

Re: fs was hung and sort of full

2018-02-23 Thread Rich Rauenzahn
It is still hanging afterall. Currently, it hangs on mount: [154422.778624] mount D0 27894 27742 0x0084 [154422.778625] Call Trace: [154422.779018] __schedule+0x28d/0x880 [154422.779494] schedule+0x36/0x80 [154422.779886] io_schedule+0x16/0x40 [154422.780288]

Re: [PATCH v2] btrfs: fix bare unsigned declarations

2018-02-23 Thread David Sterba
On Thu, Feb 15, 2018 at 01:13:00AM +0800, Anand Jain wrote: > We have btrfs_fs_info::data_chunk_allocations and > btrfs_fs_info::metadata_ratio declared as unsigned which would > be unsinged int and kernel style prefers unsigned int over bare > unsigned. So this patch changes them to u32. > >

Re: [PATCH] btrfs: fix endianness in super_copy

2018-02-23 Thread David Sterba
On Thu, Feb 22, 2018 at 09:58:42PM +0800, Anand Jain wrote: > Moving between opposite endianness will report bogus numbers in sysfs, > and mount may fail as the root will not be restored correctly. If the > filesystem is always used on a same endian host, this will not be a > problem. > Fix this

Re: [PATCH v2 11/27] libbtrfsutil: add subvolume iterator helpers

2018-02-23 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 04:40:45PM +0900, Misono, Tomohiro wrote: > On 2018/02/16 4:04, Omar Sandoval wrote: > > From: Omar Sandoval > > > +PUBLIC enum btrfs_util_error btrfs_util_create_subvolume_iterator(const > > char *path, > > +

Re: [PATCH v2 26/27] btrfs-progs: use libbtrfsutil for subvolume list

2018-02-23 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 11:26:35AM +0900, Misono, Tomohiro wrote: > > > On 2018/02/16 4:05, Omar Sandoval wrote: > > From: Omar Sandoval > > > +static struct subvol_list *btrfs_list_deleted_subvols(int fd, > > + struct > >

Re: [PATCH] btrfs: Relax memory barrier in btrfs_tree_unlock

2018-02-23 Thread David Sterba
On Wed, Feb 14, 2018 at 02:37:26PM +0200, Nikolay Borisov wrote: > When performing an unlock on an extent buffer we'd like to order the > decrement of extent_buffer::blocking_writers with waking up any > waiters. In such situations it's sufficient to use smp_mb__after_atomic > rather than the

Re: [PATCH 1/2] btrfs: drop num argument from find_live_mirror()

2018-02-23 Thread David Sterba
On Tue, Jan 30, 2018 at 02:28:30PM +0800, Anand Jain wrote: > Obtain the stripes info from the map directly and so no need > to pass it as an argument. > > Signed-off-by: Anand Jain > --- > fs/btrfs/volumes.c | 14 +++--- > 1 file changed, 11 insertions(+), 3

Re: [PATCH v2] btrfs: verify subvolid mount parameter

2018-02-23 Thread David Sterba
On Thu, Feb 15, 2018 at 01:11:37AM +0800, Anand Jain wrote: > We aren't verifying the parameter passed to the subvolid mount option, > so we won't report and fail the mount if a junk value is specified for > example, -o subvolid=abc. > This patch verifies the subvolid option with match_u64. > >

Re: [RFC PATCH] btrfs: Speedup btrfs_read_block_groups()

2018-02-23 Thread Qu Wenruo
On 2018年02月24日 00:29, Ellis H. Wilson III wrote: > On 02/22/2018 06:37 PM, Qu Wenruo wrote: >> On 2018年02月23日 00:31, Ellis H. Wilson III wrote: >>> On 02/21/2018 11:56 PM, Qu Wenruo wrote: On 2018年02月22日 12:52, Qu Wenruo wrote: > btrfs_read_block_groups() is used to build up the block

Re: [PATCH] btrfs: Add nossd_spread mount option

2018-02-23 Thread Howard McLauchlan
On 02/21/2018 05:20 PM, Hans van Kranenburg wrote: > On 02/22/2018 12:31 AM, Howard McLauchlan wrote: >> Btrfs has two mount options for SSD optimizations: ssd and ssd_spread. >> Presently there is an option to disable all SSD optimizations, but there >> isn't an option to disable just ssd_spread.

Please update the BTRFS status page

2018-02-23 Thread waxhead
The latest released kernel is 4.15 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Nikolay Borisov
On 23.02.2018 01:34, Qu Wenruo wrote: > > > On 2018年02月23日 06:44, Jeff Mahoney wrote: >> On 12/22/17 1:18 AM, Qu Wenruo wrote: >>> Unlike reservation calculation used in inode rsv for metadata, qgroup >>> doesn't really need to care things like csum size or extent usage for >>> whole tree COW.

Re: [PATCH v2 06/27] libbtrfsutil: add btrfs_util_create_subvolume()

2018-02-23 Thread Misono, Tomohiro
On 2018/02/16 4:04, Omar Sandoval wrote: > From: Omar Sandoval > +static enum btrfs_util_error openat_parent_and_name(int dirfd, const char > *path, > + char *name, size_t name_len, > +

Re: btrfs crash consistency bug : Blocks allocated beyond eof are lost

2018-02-23 Thread Filipe Manana
On Fri, Feb 23, 2018 at 4:35 PM, Jayashree Mohan wrote: > Hi, > > [Fsync issue in btrfs] > In addition to the above, I would like to bring to your notice that : > After doing a fallocate or fallocate zero_range with keep size option, > a fsync() operation would have no

Re: [RFC PATCH] btrfs: Speedup btrfs_read_block_groups()

2018-02-23 Thread Ellis H. Wilson III
On 02/22/2018 06:37 PM, Qu Wenruo wrote: On 2018年02月23日 00:31, Ellis H. Wilson III wrote: On 02/21/2018 11:56 PM, Qu Wenruo wrote: On 2018年02月22日 12:52, Qu Wenruo wrote: btrfs_read_block_groups() is used to build up the block group cache for all block groups, so it will iterate all block

Re: btrfs crash consistency bug : Blocks allocated beyond eof are lost

2018-02-23 Thread Jayashree Mohan
Hi, [Fsync issue in btrfs] In addition to the above, I would like to bring to your notice that : After doing a fallocate or fallocate zero_range with keep size option, a fsync() operation would have no effect at all. If we crash after the fsync, on recovery the blocks allocated due to the

Re: lots of data written, but no space occupied

2018-02-23 Thread André Weidemann
On 23.02.2018 00:50, Chris Murphy wrote: The only thing I can think of is something's updating metadata due to relatime mount option. Maybe try noatime? At 9GiB, really it's 4.5GiB because whatever is being written is being doubled by raid1 profile and multiple devices. There is a case of

Re: [PATCH v2 00/27] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library"

2018-02-23 Thread David Sterba
On Wed, Feb 21, 2018 at 10:50:32AM -0800, Omar Sandoval wrote: > On Wed, Feb 21, 2018 at 04:13:38PM +0100, David Sterba wrote: > > On Tue, Feb 20, 2018 at 07:50:48PM +0100, David Sterba wrote: > > > I have more comments or maybe questions about the future development > > > workflow, but at this

Btrfs occupies more space than du reports...

2018-02-23 Thread Shyam Prasad N
Hi, Can someone explain me why there is a difference in the number of blocks reported by df and du commands below? = # df -h /dc Filesystem Size Used Avail Use% Mounted on /dev/drbd1 746G 519G 225G 70% /dc # btrfs filesystem df -h /dc/ Data, single:

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Nikolay Borisov
On 23.02.2018 11:06, Qu Wenruo wrote: > > > On 2018年02月23日 16:14, Nikolay Borisov wrote: >> >> >> On 23.02.2018 01:34, Qu Wenruo wrote: >>> >>> >>> On 2018年02月23日 06:44, Jeff Mahoney wrote: On 12/22/17 1:18 AM, Qu Wenruo wrote: > Unlike reservation calculation used in inode rsv for

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Qu Wenruo
[snip] >> >> We don't need to do such check at call site. >> >> Just do the calculation (which should be really simple, as simple as >> nodesize * nr_items_to_add), and pass it to btrfs_qgroup_reserve_* APIs, >> which would handle the quota enabled check. >> >>> >>> be contained into the block rsv

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Qu Wenruo
On 2018年02月23日 16:14, Nikolay Borisov wrote: > > > On 23.02.2018 01:34, Qu Wenruo wrote: >> >> >> On 2018年02月23日 06:44, Jeff Mahoney wrote: >>> On 12/22/17 1:18 AM, Qu Wenruo wrote: Unlike reservation calculation used in inode rsv for metadata, qgroup doesn't really need to care

Re: Fwd: [Bug 1547319] 4.16.0-0.rc1.git4.1.fc28.x86_64 #1 Not tainted: possible recursive locking detected

2018-02-23 Thread Tomasz Kłoczko
On 22 February 2018 at 23:57, David Sterba wrote: [..] >> https://bugzilla.redhat.com/show_bug.cgi?id=1547319 >> >> Laura Abbott changed: >> >>What|Removed |Added >>

Re: Btrfs occupies more space than du reports...

2018-02-23 Thread Austin S. Hemmelgarn
On 2018-02-23 06:21, Shyam Prasad N wrote: Hi, Can someone explain me why there is a difference in the number of blocks reported by df and du commands below? = # df -h /dc Filesystem Size Used Avail Use% Mounted on /dev/drbd1 746G 519G 225G 70% /dc # btrfs

Btrfs remounted read-only due to ENOSPC in btrfs_run_delayed_refs

2018-02-23 Thread Martin Svec
Hello, we have a btrfs-based backup system using btrfs snapshots and rsync. Sometimes, we hit ENOSPC bug and the filesystem is remounted read-only. However, there's still plenty of unallocated space according to "btrfs fi usage". So I think this isn't another edge condition when btrfs runs out

Re: [PATCH v2 10/10] btrfs: qgroup: Use independent and accurate per inode qgroup rsv

2018-02-23 Thread Jeff Mahoney
On 2/22/18 6:34 PM, Qu Wenruo wrote: > > > On 2018年02月23日 06:44, Jeff Mahoney wrote: >> On 12/22/17 1:18 AM, Qu Wenruo wrote: >>> Unlike reservation calculation used in inode rsv for metadata, qgroup >>> doesn't really need to care things like csum size or extent usage for >>> whole tree COW.