[PATCH] Btrfs: use memalloc_nofs and kvzalloc() for free space tree bitmaps

2017-06-05 Thread Omar Sandoval
From: Omar Sandoval First, instead of open-coding the vmalloc() fallback, use the new kvzalloc() helper. Second, use memalloc_nofs_{save,restore}() instead of GFP_NOFS, as vmalloc() uses some GFP_KERNEL allocations internally which could lead to deadlocks. Signed-off-by: Omar Sandoval --- fs/b

Re: snapshot destruction making IO extremely slow

2017-06-05 Thread Jakob Schürz
Am 2017-05-24 um 10:23 schrieb Marat Khalili: > Hello, > >> It occurs when enabling quotas on a volume. When there are a >> lot of snapshots that are deleted, the system becomes extremely >> unresponsive (IO often waiting for 30s on a SSD). When I don't have >> quotas, removing snapshots is fast.

Re: [PATCH v2 8/9] btrfs: Check namelen before in 'btrfs_del_root_ref'

2017-06-05 Thread David Sterba
On Thu, Jun 01, 2017 at 04:57:15PM +0800, Su Yue wrote: > Call btrfs_is_namelen_valid before memcmp. > > Signed-off-by: Su Yue > --- > fs/btrfs/root-tree.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c > index 7d6bc308bf43..7a5450600

Re: [PATCH] Btrfs: use memalloc_nofs and kvzalloc() for free space tree bitmaps

2017-06-05 Thread David Sterba
On Mon, Jun 05, 2017 at 12:12:31AM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > First, instead of open-coding the vmalloc() fallback, use the new > kvzalloc() helper. Second, use memalloc_nofs_{save,restore}() instead of > GFP_NOFS, as vmalloc() uses some GFP_KERNEL allocations internall

Re: [PATCH 07/10] fs: return on congested block device

2017-06-05 Thread Jens Axboe
On 06/04/2017 11:35 PM, Goldwyn Rodrigues wrote: > @@ -1900,6 +1905,17 @@ generic_make_request_checks(struct bio *bio) > goto end_io; > } > > + /* > + * For a REQ_NOWAIT based request, return -EOPNOTSUPP > + * if queue does not have QUEUE_FLAG_NOWAIT_SUPPORT set

Re: [PATCH] btrfs: simplify code with bio_io_error

2017-06-05 Thread David Sterba
On Fri, Jun 02, 2017 at 04:08:50PM +0800, Guoqing Jiang wrote: > bio_io_error was introduced in the commit 4246a0b > ("block: add a bi_error field to struct bio"), so > use it to simplify code. > > Signed-off-by: Guoqing Jiang Reviewed-by: David Sterba -- To unsubscribe from this list: send the

[PATCH] Btrfs: Improve btrfs_ioctl_search_key documentation

2017-06-05 Thread Hans van Kranenburg
A programmer who is trying to implement calling the btrfs SEARCH or SEARCH_V2 ioctl will probably soon end up reading this struct definition. Properly document the input fields to prevent common misconceptions: 1. The search space is linear, not 3 dimensional. 2. The transaction id (a.k.a. gener

Re: [PATCH v5 1/2] Btrfs: lzo.c - compressed data size must be less then input size

2017-06-05 Thread David Sterba
On Tue, May 30, 2017 at 02:18:04AM +0300, Timofey Titovets wrote: > Logic already return error if compression > make data bigger, let's sync logic with zlib > and also return error if compressed size > are equal to input size > > Signed-off-by: Timofey Titovets Reviewed-by: David Sterba I've u

Re: [PATCH] Btrfs: Improve btrfs_ioctl_search_key documentation

2017-06-05 Thread Hans van Kranenburg
On 06/05/2017 05:27 PM, Hans van Kranenburg wrote: > A programmer who is trying to implement calling the btrfs SEARCH > or SEARCH_V2 ioctl will probably soon end up reading this struct > definition. > > Properly document the input fields to prevent common misconceptions: > 1. The search space is

Re: [PATCH v5 2/2] Btrfs: compression must free at least one sector size

2017-06-05 Thread David Sterba
On Tue, May 30, 2017 at 02:18:05AM +0300, Timofey Titovets wrote: > Btrfs already skip store of data where compression didn't > free at least one byte. Let's make logic better and make check > that compression free at least one sector size > because in another case it useless to store this data com

Re: [RFC PATCH] btrfs: qgroup: Fix hang when using inode_cache and qgroup

2017-06-05 Thread Goldwyn Rodrigues
On 05/31/2017 03:08 AM, Qu Wenruo wrote: > Commit 48a89bc4f2ce ("btrfs: qgroups: Retry after commit on getting EDQUOT") > is causing hang, with the following backtrace: > > Call Trace: > __schedule+0x374/0xaf0 > schedule+0x3d/0x90 > wait_for_commit+0x4a/0x80 [btrfs] > ? wake_atomic_t_functio

[PULL] Btrfs fixes for 4.12

2017-06-05 Thread David Sterba
Hi, please pull the following assorted fixes to 4.12. Thanks. The following changes since commit 9bcaaea7418d09691f1ffab5c49aacafe3eef9d0: btrfs: fix the gfp_mask for the reada_zones radix tree (2017-05-04 16:56:11 -0700) are available in the git repository at: git://git.kernel.org/pub/s

Re: [PATCH v5 2/2] Btrfs: compression must free at least one sector size

2017-06-05 Thread Timofey Titovets
2017-06-05 19:10 GMT+03:00 David Sterba : > On Tue, May 30, 2017 at 02:18:05AM +0300, Timofey Titovets wrote: >> Btrfs already skip store of data where compression didn't >> free at least one byte. Let's make logic better and make check >> that compression free at least one sector size >> because i

Re: [PATCH] Btrfs: Improve btrfs_ioctl_search_key documentation

2017-06-05 Thread Goffredo Baroncelli
On 2017-06-05 17:27, Hans van Kranenburg wrote: > + * When doing a tree search, we're actually taking a slice from a linear > + * search space of 136-bit keys: > + * > + * Key of the first possible item to be returned: > + * (min_objectid << 72) + (min_type << 64) + min_o

Re: [PATCH] Btrfs: skip commit transaction if we don't have enough pinned bytes

2017-06-05 Thread Liu Bo
On Fri, Jun 02, 2017 at 11:14:13AM -0700, Omar Sandoval wrote: > On Fri, May 19, 2017 at 11:39:15AM -0600, Liu Bo wrote: > > We commit transaction in order to reclaim space from pinned bytes because > > it could process delayed refs, and in may_commit_transaction(), we check > > first if pinned byt

Re: [PATCH] Btrfs: Improve btrfs_ioctl_search_key documentation

2017-06-05 Thread Hans van Kranenburg
On 06/05/2017 09:00 PM, Goffredo Baroncelli wrote: > On 2017-06-05 17:27, Hans van Kranenburg wrote: >> + * When doing a tree search, we're actually taking a slice from a linear >> + * search space of 136-bit keys: >> + * >> + * Key of the first possible item to be returned: >> +

[PATCH v2] Btrfs: btrfs_ioctl_search_key documentation

2017-06-05 Thread Hans van Kranenburg
A programmer who is trying to implement calling the btrfs SEARCH or SEARCH_V2 ioctl will probably soon end up reading this struct definition. Properly document the input fields to prevent common misconceptions: 1. The search space is linear, not 3 dimensional. The invidual min/max values for obj

[PATCH] btrfs-progs: send operates on ro snapshots only

2017-06-05 Thread Hans van Kranenburg
While talking to another btrfs user on IRC today, it became clear that a major point of confusion in the btrfs send manual is that it's not telling the user soon enough that send/receive solely operates on subvolume snapshots instead of the original (read/write) subvolumes. So, change the first fe

device-mapper btrfs Warning Spam

2017-06-05 Thread Steven Bell
Hello all, I have a btrfs raid-0 array (initially a raid-6 but long ago converted due to warnings not to use raid56, not that I think this impacts my situation). One of the disks in the array started to go bad. Some bad sectors meant one of my video files was unable to be read. This issue was di

Re: [PATCH] Btrfs: skip commit transaction if we don't have enough pinned bytes

2017-06-05 Thread Liu Bo
On Fri, Jun 02, 2017 at 11:14:13AM -0700, Omar Sandoval wrote: > On Fri, May 19, 2017 at 11:39:15AM -0600, Liu Bo wrote: > > We commit transaction in order to reclaim space from pinned bytes because > > it could process delayed refs, and in may_commit_transaction(), we check > > first if pinned byt

Re: [PATCH] btrfs-progs: send operates on ro snapshots only

2017-06-05 Thread Duncan
Hans van Kranenburg posted on Tue, 06 Jun 2017 01:32:18 +0200 as excerpted: > While talking to another btrfs user on IRC today, it became clear that a > major point of confusion in the btrfs send manual is that it's not > telling the user soon enough that send/receive solely operates on > subvolum