]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: always use ext2fs_mmp_get_mem to allocate fs->mmp_buf
authorDarrick J. Wong <djwong@kernel.org>
Tue, 7 Oct 2025 17:41:58 +0000 (10:41 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 9 Mar 2026 02:14:03 +0000 (19:14 -0700)
Always use our special allocator function to allocate the MMP buffer.
This will be useful in case we ever pass that buffer to ext2fs_mmp_write
on a filesystem that is opened with O_DIRECT.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
e2fsck/unix.c
lib/ext2fs/dupfs.c
lib/ext2fs/mmp.c
misc/dumpe2fs.c

index 7768f0ed7c4e3e2565b03b4f2904a9259b3b0c2c..335ca37763e65fb8613fa2be539d09f3c1612b29 100644 (file)
@@ -1230,7 +1230,7 @@ static errcode_t e2fsck_check_mmp(ext2_filsys fs, e2fsck_t ctx)
 
        clear_problem_context(&pctx);
        if (fs->mmp_buf == NULL) {
-               retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(fs, &fs->mmp_buf);
                if (retval)
                        goto check_error;
        }
index 0fd4e6c67afb5d3bc7b5c32e3472f1a28481dda9..db3a812d8d1c0d9c6316dc7f483cecc52a95ad3e 100644 (file)
@@ -91,7 +91,7 @@ errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest)
                        goto errout;
        }
        if (src->mmp_buf) {
-               retval = ext2fs_get_mem(src->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(src, &fs->mmp_buf);
                if (retval)
                        goto errout;
                memcpy(fs->mmp_buf, src->mmp_buf, src->blocksize);
index 41ef4e3e2aa6c5764a000c370a03ac288e36287b..e2823732e2b6a2fdcd29d6fc6e978e604660da92 100644 (file)
@@ -204,7 +204,7 @@ static errcode_t ext2fs_mmp_reset(ext2_filsys fs)
        errcode_t retval = 0;
 
        if (fs->mmp_buf == NULL) {
-               retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(fs, &fs->mmp_buf);
                if (retval)
                        goto out;
        }
@@ -268,7 +268,7 @@ errcode_t ext2fs_mmp_init(ext2_filsys fs)
                return EXT2_ET_INVALID_ARGUMENT;
 
        if (fs->mmp_buf == NULL) {
-               retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(fs, &fs->mmp_buf);
                if (retval)
                        goto out;
        }
@@ -306,7 +306,7 @@ errcode_t ext2fs_mmp_start(ext2_filsys fs)
        errcode_t retval = 0;
 
        if (fs->mmp_buf == NULL) {
-               retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(fs, &fs->mmp_buf);
                if (retval)
                        goto mmp_error;
        }
index b56d15d98caa473e9d70066b0016c4532a57507a..1754fd4a999b9f9ae7ed73e2394a62a69230821e 100644 (file)
@@ -472,7 +472,7 @@ static void print_mmp_block(ext2_filsys fs)
        errcode_t retval;
 
        if (fs->mmp_buf == NULL) {
-               retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+               retval = ext2fs_mmp_get_mem(fs, &fs->mmp_buf);
                if (retval) {
                        com_err(program_name, retval,
                                _("failed to alloc MMP buffer\n"));