alistair23-linux/fs/btrfs
Qu Wenruo 0b78877a2a Revert "btrfs: qgroups: Retry after commit on getting EDQUOT"
This reverts commit 48a89bc4f2.

The idea to commit transaction and free some space after hitting qgroup
limit is good, although the problem is it can easily cause deadlocks.

One deadlock example is caused by trying to flush data while still
holding it:

Call Trace:
 __schedule+0x49d/0x10f0
 schedule+0xc6/0x290
 schedule_timeout+0x187/0x1c0
 wait_for_completion+0x204/0x3a0
 btrfs_wait_ordered_extents+0xa40/0xaf0 [btrfs]
 qgroup_reserve+0x913/0xa10 [btrfs]
 btrfs_qgroup_reserve_data+0x3ef/0x580 [btrfs]
 btrfs_check_data_free_space+0x96/0xd0 [btrfs]
 __btrfs_buffered_write+0x3ac/0xd40 [btrfs]
 btrfs_file_write_iter+0x62a/0xba0 [btrfs]
 __vfs_write+0x320/0x430
 vfs_write+0x107/0x270
 SyS_write+0xbf/0x150
 do_syscall_64+0x1b0/0x3d0
 entry_SYSCALL64_slow_path+0x25/0x25

Another can be caused by trying to commit one transaction while nesting
with trans handle held by ourselves:

btrfs_start_transaction()
|- btrfs_qgroup_reserve_meta_pertrans()
   |- qgroup_reserve()
      |- btrfs_join_transaction()
      |- btrfs_commit_transaction()

The retry is causing more problems than exppected when limit is enabled.
At least a graceful EDQUOT is way better than deadlock.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-31 02:01:05 +02:00
..
tests Btrfs: extent map selftest: add missing void parameter to btrfs_test_extent_map 2018-03-26 15:09:29 +02:00
acl.c btrfs: drop underscores from exported xattr functions 2018-03-26 15:09:41 +02:00
async-thread.c Btrfs: fix confusing worker helper info in stacktrace 2017-10-30 12:27:57 +01:00
async-thread.h btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
backref.c btrfs: Remove unused op_key var from add_delayed_refs 2018-03-31 01:26:57 +02:00
backref.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
btrfs_inode.h btrfs: open code trivial helper btrfs_page_exists_in_range 2018-03-31 01:26:50 +02:00
check-integrity.c btrfs: Remove custom crc32c init code 2018-03-26 15:09:39 +02:00
check-integrity.h btrfs: take an fs_info directly when the root is not used otherwise 2016-12-06 16:06:59 +01:00
compression.c btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
compression.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
ctree.c btrfs: kill tree_mod_log_set_root_pointer helper 2018-03-31 01:26:55 +02:00
ctree.h btrfs: qgroup: Use root::qgroup_meta_rsv_* to record qgroup meta reserved space 2018-03-31 02:01:04 +02:00
dedupe.h btrfs: expand cow_file_range() to support in-band dedup and subpage-blocksize 2016-07-26 13:52:25 +02:00
delayed-inode.c btrfs: delayed-inode: Use new qgroup meta rsv for delayed inode and item 2018-03-31 02:01:03 +02:00
delayed-inode.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
delayed-ref.c btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
delayed-ref.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
dev-replace.c btrfs: log, when replace, is canceled by the user 2018-03-26 15:09:34 +02:00
dev-replace.h btrfs: btrfs_dev_replace_cancel() can return int 2018-03-26 15:09:30 +02:00
dir-item.c btrfs: Remove custom crc32c init code 2018-03-26 15:09:39 +02:00
disk-io.c btrfs: qgroup: Use root::qgroup_meta_rsv_* to record qgroup meta reserved space 2018-03-31 02:01:04 +02:00
disk-io.h btrfs: separate types for submit_bio_start and submit_bio_done 2018-03-31 01:26:55 +02:00
export.c btrfs: Cleanup existing name_len checks 2018-01-22 16:08:12 +01:00
export.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extent-tree.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
extent_io.c btrfs: document more parameters of submit_extent_page 2018-03-31 01:26:53 +02:00
extent_io.h btrfs: remove unused parameters from extent_submit_bio_done_t 2018-03-31 01:26:55 +02:00
extent_map.c btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
extent_map.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
file-item.c Merge branch 'for-4.13-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-05 16:41:23 -07:00
file.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
free-space-cache.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
free-space-cache.h btrfs: free-space-cache, clean up unnecessary root arguments 2017-02-17 12:03:56 +01:00
free-space-tree.c btrfs: use reada direction enum instead of constant value in load_free_space_tree 2018-03-26 15:09:37 +02:00
free-space-tree.h btrfs: expose internal free space tree routine only if sanity tests are enabled 2017-08-18 16:36:29 +02:00
inode-item.c btrfs: Remove custom crc32c init code 2018-03-26 15:09:39 +02:00
inode-map.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
inode-map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
inode.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
ioctl.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
Kconfig btrfs: Remove custom crc32c init code 2018-03-26 15:09:39 +02:00
locking.c btrfs: Relax memory barrier in btrfs_tree_unlock 2018-03-31 01:26:51 +02:00
locking.h btrfs: fix lockups from btrfs_clear_path_blocking 2014-11-19 10:34:35 -08:00
lzo.c btrfs: Remove unused tot_len var from lzo_decompress 2018-03-31 01:26:57 +02:00
Makefile btrfs: Remove custom crc32c init code 2018-03-26 15:09:39 +02:00
math.h btrfs: cleanup 64bit/32bit divs, compile time constants 2015-03-03 17:23:57 +01:00
ordered-data.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
ordered-data.h btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
orphan.c btrfs: kill the key type accessor helpers 2014-09-17 13:37:12 -07:00
print-tree.c Btrfs: add one more sanity check for shared ref type 2017-08-21 17:47:43 +02:00
print-tree.h btrfs: get fs_info from eb in btrfs_print_tree, remove argument 2017-08-16 16:12:03 +02:00
props.c btrfs: drop underscores from exported xattr functions 2018-03-26 15:09:41 +02:00
props.h
qgroup.c Revert "btrfs: qgroups: Retry after commit on getting EDQUOT" 2018-03-31 02:01:05 +02:00
qgroup.h btrfs: qgroup: Introduce function to convert META_PREALLOC into META_PERTRANS 2018-03-31 01:41:14 +02:00
raid56.c Btrfs: replace: cache rbio when rebuild data on missing device 2018-03-31 01:41:12 +02:00
raid56.h btrfs: take an fs_info directly when the root is not used otherwise 2016-12-06 16:06:59 +01:00
rcu-string.h
reada.c btrfs: remove unused member err from reada_extent 2017-06-19 18:25:59 +02:00
ref-verify.c btrfs: ref-verify: Remove unused parameter from walk_up_tree() to kill warning 2018-01-22 16:08:13 +01:00
ref-verify.h Btrfs: add a extent ref verify tool 2017-10-30 12:28:00 +01:00
relocation.c btrfs: qgroup: Use separate meta reservation type for delalloc 2018-03-31 01:41:14 +02:00
root-tree.c btrfs: Cleanup existing name_len checks 2018-01-22 16:08:12 +01:00
scrub.c btrfs: Remove unused length var from scrub_handle_errored_block 2018-03-31 01:26:57 +02:00
send.c Btrfs: send: fix typo in TLV_PUT 2018-03-26 15:09:42 +02:00
send.h btrfs: fix send ioctl on 32bit with 64bit kernel 2017-10-30 12:27:59 +01:00
struct-funcs.c btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
super.c btrfs: sort and group mount option definitions 2018-03-31 01:26:52 +02:00
sysfs.c btrfs: defer adding raid type kobject until after chunk relocation 2018-03-31 01:41:12 +02:00
sysfs.h Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-11-14 13:35:29 -08:00
transaction.c btrfs: qgroup: Split meta rsv type into meta_prealloc and meta_pertrans 2018-03-31 01:41:14 +02:00
transaction.h btrfs: Remove code referencing unused TRANS_USERSPACE 2018-03-31 01:26:51 +02:00
tree-checker.c btrfs: add more __cold annotations 2018-03-26 15:09:39 +02:00
tree-checker.h btrfs: tree-checker: Replace root parameter with fs_info 2018-03-26 15:09:38 +02:00
tree-defrag.c btrfs: add define for oldest generation 2018-03-31 01:26:50 +02:00
tree-log.c btrfs: Remove root argument from btrfs_log_dentry_safe 2018-03-26 15:09:42 +02:00
tree-log.h btrfs: Remove root argument from btrfs_log_dentry_safe 2018-03-26 15:09:42 +02:00
ulist.c btrfs: ulist: rename ulist_fini to ulist_release 2017-02-17 12:03:50 +01:00
ulist.h btrfs: ulist: rename ulist_fini to ulist_release 2017-02-17 12:03:50 +01:00
uuid-tree.c btrfs: add define for oldest generation 2018-03-31 01:26:50 +02:00
volumes.c btrfs: defer adding raid type kobject until after chunk relocation 2018-03-31 01:41:12 +02:00
volumes.h btrfs: rename btrfs_close_extra_device to btrfs_free_extra_devids 2018-03-26 15:09:42 +02:00
xattr.c btrfs: adjust return type of btrfs_getxattr 2018-03-26 15:09:41 +02:00
xattr.h btrfs: move btrfs_listxattr prototype to xattr.h 2018-03-26 15:09:41 +02:00
zlib.c btrfs: allow to set compression level for zlib 2017-11-01 20:45:29 +01:00
zstd.c btrfs: move some zstd work data from stack to workspace 2018-01-22 16:08:14 +01:00