Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-24 Thread Josef Bacik
On Mon, Jul 24, 2017 at 03:14:08PM +0200, David Sterba wrote: > On Mon, Jul 24, 2017 at 02:50:50PM +0200, David Sterba wrote: > > On Fri, Jul 21, 2017 at 01:29:08PM -0400, jo...@toxicpanda.com wrote: > > > From: Josef Bacik > > > > > > Readdir does dir_emit while under the btree

Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-24 Thread Josef Bacik
On Mon, Jul 24, 2017 at 11:26:49AM +0300, Nikolay Borisov wrote: > > > On 21.07.2017 20:29, jo...@toxicpanda.com wrote: > > From: Josef Bacik > > > > Readdir does dir_emit while under the btree lock. dir_emit can trigger > > the page fault which means we can deadlock. Fix this

Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-24 Thread David Sterba
On Mon, Jul 24, 2017 at 02:50:50PM +0200, David Sterba wrote: > On Fri, Jul 21, 2017 at 01:29:08PM -0400, jo...@toxicpanda.com wrote: > > From: Josef Bacik > > > > Readdir does dir_emit while under the btree lock. dir_emit can trigger > > the page fault which means we can

Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-24 Thread David Sterba
On Fri, Jul 21, 2017 at 01:29:08PM -0400, jo...@toxicpanda.com wrote: > From: Josef Bacik > > Readdir does dir_emit while under the btree lock. dir_emit can trigger > the page fault which means we can deadlock. Fix this by allocating a > buffer on opening a directory and copying

Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-24 Thread Nikolay Borisov
On 21.07.2017 20:29, jo...@toxicpanda.com wrote: > From: Josef Bacik > > Readdir does dir_emit while under the btree lock. dir_emit can trigger > the page fault which means we can deadlock. Fix this by allocating a > buffer on opening a directory and copying the readdir into

Re: [PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-21 Thread Josef Bacik
On Fri, Jul 21, 2017 at 01:29:08PM -0400, jo...@toxicpanda.com wrote: > From: Josef Bacik > > Readdir does dir_emit while under the btree lock. dir_emit can trigger > the page fault which means we can deadlock. Fix this by allocating a > buffer on opening a directory and copying

[PATCH 2/3] btrfs: fix readdir deadlock with pagefault

2017-07-21 Thread josef
From: Josef Bacik Readdir does dir_emit while under the btree lock. dir_emit can trigger the page fault which means we can deadlock. Fix this by allocating a buffer on opening a directory and copying the readdir into this buffer and doing dir_emit from outside of the tree lock.