linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] ext4: clean up and refactor fallocate
@ 2024-09-04  6:29 Zhang Yi
  2024-09-04  6:29 ` [PATCH v2 01/10] ext4: write out dirty data before dropping pages Zhang Yi
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Zhang Yi @ 2024-09-04  6:29 UTC (permalink / raw)
  To: linux-ext4
  Cc: linux-fsdevel, linux-kernel, tytso, adilger.kernel, jack,
	ritesh.list, yi.zhang, yi.zhang, chengzhihao1, yukuai3

From: Zhang Yi <yi.zhang@huawei.com>

Changes since v1:
 - Fix an using uninitialized variable problem in the error out path in
   ext4_do_fallocate() in patch 08.

Current ext4 fallocate code is mess with mode checking, locking, input
parameter checking, position calculation, and having some stale code.
Almost all of the five sub-functions have the same preparation, it
deserve a clean up now.

This series tries to clean this up by refactor all fallocate related
operations, it unify variable naming, reduce some unnecessary position
calculation, factor out one common helper to check input parameters, and
also foctor out one common helper to wait for the dios to finish, hold
filemap invalidate lock, write back dirty data and drop page cache.

The first patch fix a potential data loss problem when punch hole, zero
range and collapse range by always write back dirty pages. Later patchs
do cleanup and refactor work, please see them for details. After this
series, we can reduce a lot of redundant code and make it more clear
than before.

Thanks,
Yi.

Zhang Yi (10):
  ext4: write out dirty data before dropping pages
  ext4: don't explicit update times in ext4_fallocate()
  ext4: drop ext4_update_disksize_before_punch()
  ext4: refactor ext4_zero_range()
  ext4: refactor ext4_punch_hole()
  ext4: refactor ext4_collapse_range()
  ext4: refactor ext4_insert_range()
  ext4: factor out ext4_do_fallocate()
  ext4: factor out the common checking part of all fallocate operations
  ext4: factor out a common helper to lock and flush data before
    fallocate

 fs/ext4/ext4.h    |   5 +-
 fs/ext4/extents.c | 566 +++++++++++++++++++---------------------------
 fs/ext4/inode.c   | 173 ++++----------
 3 files changed, 278 insertions(+), 466 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2024-09-24 11:10 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04  6:29 [PATCH v2 00/10] ext4: clean up and refactor fallocate Zhang Yi
2024-09-04  6:29 ` [PATCH v2 01/10] ext4: write out dirty data before dropping pages Zhang Yi
2024-09-17 16:50   ` Jan Kara
2024-09-18 12:27     ` Zhang Yi
2024-09-04  6:29 ` [PATCH v2 02/10] ext4: don't explicit update times in ext4_fallocate() Zhang Yi
2024-09-20 16:04   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 03/10] ext4: drop ext4_update_disksize_before_punch() Zhang Yi
2024-09-20 16:13   ` Jan Kara
2024-09-24  7:43     ` Zhang Yi
2024-09-24 10:11       ` Jan Kara
2024-09-24 11:09         ` Zhang Yi
2024-09-04  6:29 ` [PATCH v2 04/10] ext4: refactor ext4_zero_range() Zhang Yi
2024-09-20 16:24   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 05/10] ext4: refactor ext4_punch_hole() Zhang Yi
2024-09-20 16:31   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 06/10] ext4: refactor ext4_collapse_range() Zhang Yi
2024-09-20 16:35   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 07/10] ext4: refactor ext4_insert_range() Zhang Yi
2024-09-23  8:17   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 08/10] ext4: factor out ext4_do_fallocate() Zhang Yi
2024-09-23  8:20   ` Jan Kara
2024-09-04  6:29 ` [PATCH v2 09/10] ext4: factor out the common checking part of all fallocate operations Zhang Yi
2024-09-23  8:31   ` Jan Kara
2024-09-24  7:52     ` Zhang Yi
2024-09-04  6:29 ` [PATCH v2 10/10] ext4: factor out a common helper to lock and flush data before fallocate Zhang Yi
2024-09-23  8:54   ` Jan Kara
2024-09-24  8:11     ` Zhang Yi
2024-09-24 10:05       ` Jan Kara

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