lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211019064959.625557-4-yebin10@huawei.com>
Date:   Tue, 19 Oct 2021 14:49:57 +0800
From:   Ye Bin <yebin10@...wei.com>
To:     <tytso@....edu>, <adilger.kernel@...ger.ca>,
        <linux-ext4@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <jack@...e.cz>,
        Ye Bin <yebin10@...wei.com>
Subject: [PATCH -next v3 3/5] ext4: get buffer head before read_mmp_block

There is only pass NULL 'bh' in ext4_multi_mount_protect,
So just call sb_getblk get buffer head fisrt, and we will
simplify read_mmp_block function.

Signed-off-by: Ye Bin <yebin10@...wei.com>
---
 fs/ext4/mmp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 4af8b99ade84..6ac6aacd8fa5 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -295,6 +295,10 @@ int ext4_multi_mount_protect(struct super_block *sb,
 		goto failed;
 	}
 
+	bh = sb_getblk(sb, mmp_block);
+	if (bh)
+		goto failed;
+
 	retval = read_mmp_block(sb, &bh, mmp_block);
 	if (retval)
 		goto failed;
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ