linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tests/ext4: Ensure resizes with sparse_super2 are handled correctly
@ 2022-02-22 17:50 Ojaswin Mujoo
  2022-02-22 17:50 ` [PATCH v2 1/2] src/ext4_resize.c: Refactor code and ensure accurate errno is returned Ojaswin Mujoo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ojaswin Mujoo @ 2022-02-22 17:50 UTC (permalink / raw)
  To: fstests, linux-ext4; +Cc: riteshh

As detailed in the patch [1], kernel currently does not support resizes
with sparse_super2 enabled.  Before the above patch, if we used the
EXT4_IOC_RESIZE_FS ioctl directly, wiht sparse_super2 enabled, the
kernel used to still try the resize and ultimatley leave the fs in an
inconsistent state. This also led to corruption and kernel BUGs.

This patchset adds a test for ext4 to ensure that the kernel handles
resizes with sparse_super2 correctly, and returns -EOPNOTSUPP. 

Summary:

  Patch 1: Fix the src/ext4_resize.c script to return accurate error
           codes.
  Patch 2: Add the ext4 test for checking resize functionality

Changes since v1 [2]

  *  In patch 2, don't iterate if the expected errno is returned
  *  Code cleanup and additional comments for clarity (also see extra
     note in patch 2)
  *  No changes in patch 1

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b1489186cc8391e0c1e342f9fbc3eedf6b944c61
[2] https://lore.kernel.org/fstests/cover.1644217569.git.ojaswin@linux.ibm.com/ 

Ojaswin Mujoo (2):
  src/ext4_resize.c: Refactor code and ensure accurate errno is returned
  ext4: Test to ensure resize with sparse_super2 is handled correctly

 src/ext4_resize.c  |  46 +++++++++++++------
 tests/ext4/056     | 108 +++++++++++++++++++++++++++++++++++++++++++++
 tests/ext4/056.out |   2 +
 3 files changed, 142 insertions(+), 14 deletions(-)
 create mode 100755 tests/ext4/056
 create mode 100644 tests/ext4/056.out

-- 
2.27.0


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

end of thread, other threads:[~2022-04-18  5:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22 17:50 [PATCH v2 0/2] tests/ext4: Ensure resizes with sparse_super2 are handled correctly Ojaswin Mujoo
2022-02-22 17:50 ` [PATCH v2 1/2] src/ext4_resize.c: Refactor code and ensure accurate errno is returned Ojaswin Mujoo
2022-02-22 17:50 ` [PATCH v2 2/2] ext4: Test to ensure resize with sparse_super2 is handled correctly Ojaswin Mujoo
2022-04-10 10:36   ` Eryu Guan
2022-04-18  5:45     ` Ojaswin Mujoo
2022-03-08 10:16 ` [PATCH v2 0/2] tests/ext4: Ensure resizes with sparse_super2 are " Ojaswin Mujoo

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