projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3584c8f
)
ext4: Block writes to journal device
author
Jan Kara
<jack@suse.cz>
Wed, 1 Nov 2023 17:43:12 +0000
(18:43 +0100)
committer
Christian Brauner
<brauner@kernel.org>
Sat, 18 Nov 2023 13:59:26 +0000
(14:59 +0100)
Ask block layer to not allow other writers to open block device used
for ext4 journal.
Signed-off-by: Jan Kara <jack@suse.cz>
Link:
https://lore.kernel.org/r/20231101174325.10596-7-jack@suse.cz
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ext4/super.c
patch
|
blob
|
history
diff --git
a/fs/ext4/super.c
b/fs/ext4/super.c
index bd752f3f1dd526d9935f9d5796f0f617c03213d8..0980845c8b8f103acc906e21d0f2c9a9f2f64ab6 100644
(file)
--- a/
fs/ext4/super.c
+++ b/
fs/ext4/super.c
@@
-5864,8
+5864,9
@@
static struct bdev_handle *ext4_get_journal_blkdev(struct super_block *sb,
struct ext4_super_block *es;
int errno;
- bdev_handle = bdev_open_by_dev(j_dev, BLK_OPEN_READ | BLK_OPEN_WRITE,
- sb, &fs_holder_ops);
+ bdev_handle = bdev_open_by_dev(j_dev,
+ BLK_OPEN_READ | BLK_OPEN_WRITE | BLK_OPEN_RESTRICT_WRITES,
+ sb, &fs_holder_ops);
if (IS_ERR(bdev_handle)) {
ext4_msg(sb, KERN_ERR,
"failed to open journal device unknown-block(%u,%u) %ld",