Home
last modified time | relevance | path

Searched hist:"23 b5ec74" (Results 1 – 4 of 4) sorted by relevance

/openbmc/linux/fs/btrfs/
H A Dioctl.c23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
H A Dfile.c23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
H A Dctree.h23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
H A Dinode.c23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
23b5ec74 Mon Jul 24 14:14:25 CDT 2017 Josef Bacik <jbacik@fb.com> btrfs: fix readdir deadlock with pagefault

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.

Thread A
readdir <holding tree lock>
dir_emit
<page fault>
down_read(mmap_sem)

Thread B
mmap write
down_write(mmap_sem)
page_mkwrite
wait_ordered_extents

Process C
finish_ordered_extent
insert_reserved_file_extent
try to lock leaf <hang>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copy the deadlock scenario to changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>