linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Misc improvements to dev-replace code
@ 2019-05-14 10:54 Nikolay Borisov
  2019-05-14 10:54 ` [PATCH 1/8] btrfs: Don't opencode sync_blockdev in btrfs_init_dev_replace_tgtdev Nikolay Borisov
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Nikolay Borisov @ 2019-05-14 10:54 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

While fixing the failing ASSERT in device replace finishing procedure I also 
found several oddities/bugs. Here is the resultant pile.

First 3 patches are a couple simple cleanups.

Patch 4 fixes a real bug since btrfs_init_dev_replace_tgtdev accesses values
which might be updated by transaction commit, so naturally it should be called
after the transaction is actually committed. I think this should go to stable. 

Patch 5 cleanups unlocking code in btrfs_dev_replace_start removing a goto label 
and a local variable. 

Patch 6 also fixes a bug, since persisting the dev-replace item relied on global 
reserve being able to satisfy the condition. While this is not wrong per-se I 
find it somewhat subtle, so just be explicit and start a transaction with 
reservation for at least 1 item.

Patch 7 fixes the race condition which caused the newly added ASSERT to trigger. 
I've added the Fixes: tag to point to the first commit which introduced taking 
chunk_mutex. This is also stable material. 

Patch 8 is also a minor cleanup, just removing what I believe to be a redundant 
assignment. 

This series went under multiple xfstest runs and no regressions were observed. 

Nikolay Borisov (8):
  btrfs: Don't opencode sync_blockdev in btrfs_init_dev_replace_tgtdev
  btrfs: Reduce critical section in btrfs_init_dev_replace_tgtdev
  btrfs: Remove impossible WARN_ON
  btrfs: Ensure btrfs_init_dev_replace_tgtdev sees up to date values
  btrfs: Streamline replace sem unlock in btrfs_dev_replace_start
  btrfs: Explicitly reserve space for devreplace item
  btrfs: Ensure replaced device doesn't have pending chunk allocation
  btrfs: Remove redundant assignment of tgt_device->commit_total_bytes

 fs/btrfs/dev-replace.c | 59 +++++++++++++++++++++++-------------------
 1 file changed, 32 insertions(+), 27 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2019-05-28 16:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 10:54 [PATCH 0/8] Misc improvements to dev-replace code Nikolay Borisov
2019-05-14 10:54 ` [PATCH 1/8] btrfs: Don't opencode sync_blockdev in btrfs_init_dev_replace_tgtdev Nikolay Borisov
2019-05-14 10:59   ` Johannes Thumshirn
2019-05-14 10:54 ` [PATCH 2/8] btrfs: Reduce critical section " Nikolay Borisov
2019-05-14 11:05   ` Johannes Thumshirn
2019-05-14 10:54 ` [PATCH 3/8] btrfs: Remove impossible WARN_ON Nikolay Borisov
2019-05-14 11:09   ` Johannes Thumshirn
2019-05-14 10:54 ` [PATCH 4/8] btrfs: Ensure btrfs_init_dev_replace_tgtdev sees up to date values Nikolay Borisov
2019-05-14 10:54 ` [PATCH 5/8] btrfs: Streamline replace sem unlock in btrfs_dev_replace_start Nikolay Borisov
2019-05-14 12:50   ` Johannes Thumshirn
2019-05-14 10:54 ` [PATCH 6/8] btrfs: Explicitly reserve space for devreplace item Nikolay Borisov
2019-05-14 12:56   ` Johannes Thumshirn
2019-05-14 10:54 ` [PATCH 7/8] btrfs: Ensure replaced device doesn't have pending chunk allocation Nikolay Borisov
2019-05-15 16:52   ` David Sterba
2019-05-17  7:44     ` [PATCH v2] " Nikolay Borisov
2019-05-17 14:28       ` David Sterba
2019-05-14 10:54 ` [PATCH 8/8] btrfs: Remove redundant assignment of tgt_device->commit_total_bytes Nikolay Borisov
2019-05-14 12:59   ` Johannes Thumshirn
2019-05-28 16:47 ` [PATCH 0/8] Misc improvements to dev-replace code David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).