linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] extent buffer dirty cleanups
@ 2023-01-19 21:53 Josef Bacik
  2023-01-19 21:53 ` [PATCH v2 1/9] btrfs: do not call btrfs_clean_tree_block in update_ref_for_cow Josef Bacik
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Josef Bacik @ 2023-01-19 21:53 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

v1->v2:
- Added "btrfs: do not call btrfs_clean_tree_block in update_ref_for_cow", Qu
  noticed some corruption with the original patchset, this turned out to be
  because we were clearing the extent buffer dirty at cow time, which doesn't
  make sense as we're not free'ing the current block in our current transaction.

--- Original email ---
Hello,

While sync'ing ctree.c to btrfs-progs I noticed we have some oddities when it
comes to how we deal with the extent buffer being dirty.  We have
btrfs_clean_tree_block, which is sort of meant to be run against extent buffers
we've modified in this transaction.  However we have some other places where
we've open coded the same work without the generation check.  This makes it kind
of confusing, and is inconsistent with how we deal with the
fs_info->dirty_metadata_bytes.

So clean this stuff up so we have one helper we use for setting the extent
buffer dirty (btrfs_mark_buffer_dirty) and one for clearing dirty
(btrfs_clear_buffer_dirty).  This makes everything more consistent and clean
across the board.  I've additionally cleaned up a random writeback thing we had
in tree-log that I noticed while doing these cleanups.  Thanks,

Josef

Josef Bacik (9):
  btrfs: do not call btrfs_clean_tree_block in update_ref_for_cow
  btrfs: always lock the block before calling btrfs_clean_tree_block
  btrfs: do not check header generation in btrfs_clean_tree_block
  btrfs: do not set the header generation before btrfs_clean_tree_block
  btrfs: replace clearing extent buffer dirty bit with btrfs_clean_block
  btrfs: do not increment dirty_metadata_bytes in set_btree_ioerr
  btrfs: rename btrfs_clean_tree_block => btrfs_clear_buffer_dirty
  btrfs: combine btrfs_clear_buffer_dirty and clear_extent_buffer_dirty
  btrfs: remove btrfs_wait_tree_block_writeback

 fs/btrfs/ctree.c           | 15 +++++++-------
 fs/btrfs/disk-io.c         | 25 +++++-------------------
 fs/btrfs/disk-io.h         |  2 +-
 fs/btrfs/extent-tree.c     | 12 ++++--------
 fs/btrfs/extent_io.c       | 18 +++++++++--------
 fs/btrfs/extent_io.h       |  2 +-
 fs/btrfs/free-space-tree.c |  2 +-
 fs/btrfs/ioctl.c           |  2 +-
 fs/btrfs/qgroup.c          |  2 +-
 fs/btrfs/tree-log.c        | 40 ++++++++++++++------------------------
 10 files changed, 46 insertions(+), 74 deletions(-)

-- 
2.26.3


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

end of thread, other threads:[~2023-01-24  6:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19 21:53 [PATCH v2 0/9] extent buffer dirty cleanups Josef Bacik
2023-01-19 21:53 ` [PATCH v2 1/9] btrfs: do not call btrfs_clean_tree_block in update_ref_for_cow Josef Bacik
2023-01-20  1:30   ` Qu Wenruo
2023-01-19 21:53 ` [PATCH v2 2/9] btrfs: always lock the block before calling btrfs_clean_tree_block Josef Bacik
2023-01-19 21:53 ` [PATCH v2 3/9] btrfs: do not check header generation in btrfs_clean_tree_block Josef Bacik
2023-01-19 21:53 ` [PATCH v2 4/9] btrfs: do not set the header generation before btrfs_clean_tree_block Josef Bacik
2023-01-19 21:53 ` [PATCH v2 5/9] btrfs: replace clearing extent buffer dirty bit with btrfs_clean_block Josef Bacik
2023-01-19 21:53 ` [PATCH v2 6/9] btrfs: do not increment dirty_metadata_bytes in set_btree_ioerr Josef Bacik
2023-01-19 21:53 ` [PATCH v2 7/9] btrfs: rename btrfs_clean_tree_block => btrfs_clear_buffer_dirty Josef Bacik
2023-01-19 21:53 ` [PATCH v2 8/9] btrfs: combine btrfs_clear_buffer_dirty and clear_extent_buffer_dirty Josef Bacik
2023-01-19 21:53 ` [PATCH v2 9/9] btrfs: remove btrfs_wait_tree_block_writeback Josef Bacik
2023-01-24  6:47 ` [PATCH v2 0/9] extent buffer dirty cleanups Wang Yugui

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).