Thread (11 messages) 11 messages, 3 authors, 2021-10-19
STALE1685d
Revisions (5)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
  4. v4 [diff vs current]
  5. v5 [diff vs current]

[PATCH -next v3 3/5] ext4: get buffer head before read_mmp_block

From: Ye Bin <hidden>
Date: 2021-10-19 06:37:46
Also in: lkml
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help