All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v4 0/8] Fix freeze/sysfs deadlock in better method.
@ 2015-01-29  2:24 Qu Wenruo
  2015-01-29  2:24 ` [PATCH RESEND v4 1/8] Revert "btrfs: add support for processing pending changes" related commits Qu Wenruo
                   ` (7 more replies)
  0 siblings, 8 replies; 40+ messages in thread
From: Qu Wenruo @ 2015-01-29  2:24 UTC (permalink / raw)
  To: linux-btrfs

Patchset to solve the previous found freeze/sysfs deadlock.

Unlike previous pending_changes, which uses transaction commits to
ensure mount option doesn't change during transaction.
This idea is great in concept, but will introduce extra and somewhat
duplicated ro/freeze check, and the original synchronized behavior is
also changed.

[Per-transaction mount option]
This patch use the RCU-like concept, which will copy the mount_opt from
fs_info into btrfs_transaction, and each btrfs_test_opt() for specific
mount option bit(SPACE_CACHE/INODE_MAP_CACHE) should be changed to
btrfs_test_trans_opt().
So mount option during transaction won't be changed, and also, no extra
read_only or freeze check is needed, the commit routine is also
untouched.

[Use VFS protect for sysfs change]
The 6th patch will introduce a new help function get_vfsmount_sb() to
get a vfsmount from a sb, with this vfsmount, we can use vfs level
mnt_want_write() to do a comprehensive protection other than the cheap
ro/freeze check.

Changelog:
v1:
   Only use cheap freeze check to avoid deadlock.
v2:
   Fix the never changed pending_changes bug and handle transaction in
   btrfs_freeze()
v3:
   Add atomic mount option change and per-trans mount option.
v4:
   Add mnt_want_write() in sysfs handler.

Qu Wenruo (8):
  Revert "btrfs: add support for processing pending changes" related    
    commits
  btrfs: Make btrfs_parse_options() parse mount option in a atomic way
  btrfs: Introduce per-transaction mount_opt to keep mount option    
    consistent during transaction.
  btrfs: Use btrfs_test_trans_opt() to handle SPACE_CACHE if it's under 
       transaction protect.
  btrfs: Use btrfs_test_trans_opt() to handle INODE_CACHE if it's under 
       transaction protect.
  vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.
  btrfs: Use mnt_want_write() to protect label change.
  btrfs: Use mnt_want_write() to protect sysfs feature change.

 fs/btrfs/ctree.h            |  64 +++-------------------
 fs/btrfs/disk-io.c          |   6 ---
 fs/btrfs/extent-tree.c      |   2 +-
 fs/btrfs/free-space-cache.c |   2 +-
 fs/btrfs/inode-map.c        |   5 +-
 fs/btrfs/super.c            | 129 ++++++++++++++++++++++----------------------
 fs/btrfs/sysfs.c            |  73 ++++++++++++++++++-------
 fs/btrfs/transaction.c      |  43 ++-------------
 fs/btrfs/transaction.h      |   6 ++-
 fs/namespace.c              |  25 +++++++++
 include/linux/mount.h       |   1 +
 11 files changed, 167 insertions(+), 189 deletions(-)

-- 
2.2.2


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2015-01-30  6:15 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29  2:24 [PATCH RESEND v4 0/8] Fix freeze/sysfs deadlock in better method Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 1/8] Revert "btrfs: add support for processing pending changes" related commits Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way Qu Wenruo
2015-01-30  0:31   ` Miao Xie
2015-01-30  1:20     ` Qu Wenruo
2015-01-30  1:29       ` Miao Xie
2015-01-30  1:33         ` Qu Wenruo
2015-01-30  2:06           ` Miao Xie
2015-01-30  2:51             ` Qu Wenruo
2015-01-30  3:21               ` Miao Xie
2015-01-30  3:25                 ` Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 3/8] btrfs: Introduce per-transaction mount_opt to keep mount option consistent during transaction Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 4/8] btrfs: Use btrfs_test_trans_opt() to handle SPACE_CACHE if it's under transaction protect Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 5/8] btrfs: Use btrfs_test_trans_opt() to handle INODE_CACHE " Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb Qu Wenruo
2015-01-29 12:37   ` David Sterba
2015-01-29 15:23     ` Al Viro
2015-01-30  1:11       ` Qu Wenruo
2015-01-30  1:11         ` Qu Wenruo
2015-01-30  2:09         ` Al Viro
2015-01-30  2:20           ` Qu Wenruo
2015-01-30  2:20             ` Qu Wenruo
2015-01-30  0:52   ` Miao Xie
2015-01-30  1:44     ` Qu Wenruo
2015-01-30  1:44       ` Qu Wenruo
2015-01-30  2:02       ` Qu Wenruo
2015-01-30  2:02         ` Qu Wenruo
2015-01-30  3:22         ` Miao Xie
2015-01-30  3:22           ` Miao Xie
2015-01-30  3:30           ` Qu Wenruo
2015-01-30  3:30             ` Qu Wenruo
2015-01-30  2:14       ` Al Viro
2015-01-30  4:14         ` Miao Xie
2015-01-30  4:37           ` Al Viro
2015-01-30  5:34             ` Miao Xie
2015-01-30  6:15               ` Al Viro
2015-01-30  5:30           ` Qu Wenruo
2015-01-30  5:30             ` Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 7/8] btrfs: Use mnt_want_write() to protect label change Qu Wenruo
2015-01-29  2:24 ` [PATCH RESEND v4 8/8] btrfs: Use mnt_want_write() to protect sysfs feature change Qu Wenruo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.