Re: [e2fsprogs PATCH] resize2fs: use directio when reading superblock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 07, 2023 at 11:50:41AM -0700, Krister Johansen wrote:
> The growpart / resize2fs in the reproducer are essentially verbatim from
> our system provisioning scripts.  Unless those modify the UUID, we're
> not taking any explicit action to do so.

Ah, OK.  OK, I'm guessing that your system provisioning scripts are
attempting mess with the file system a lot (creating, deleting, etc.)
files while trying to run resize2fs in parallel, then?



As far as your patch is concerned, resize2fs can do both off-line
(unmounted) and on-line (mounted) resizes.  And turning direct I/O
unconditionally isn't a great idea for off-line resizes --- it will
really trash the performance of the resize.  Does this patch work for
you instead?

					- Ted

diff --git a/resize/main.c b/resize/main.c
index 94f5ec6d..f914c050 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -409,6 +409,8 @@ int main (int argc, char ** argv)
 
 	if (!(mount_flags & EXT2_MF_MOUNTED) && !print_min_size)
 		io_flags = EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE;
+	if (mount_flags & EXT2_MF_MOUNTED)
+		io_flags |= EXT2_FLAG_DIRECT_IO;
 
 	io_flags |= EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
 	if (undo_file) {



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux