From 9907e7365cfaad37e83a31fa275b9841cf6da279 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 05:49:13 -0800 Subject: [PATCH] [PATCH] ext3: bd_claim for journal device From: Neil Brown Change ext3 to run bd_claim() against external journal devices. It is significant only for those who have ext3 journals on a separate device, and gets exclusive access to that device. --- fs/ext3/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 94b10ec1edcd7..d92187197f68e 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -340,6 +340,7 @@ fail: */ static int ext3_blkdev_put(struct block_device *bdev) { + bd_release(bdev); return blkdev_put(bdev, BDEV_FS); } @@ -1480,6 +1481,13 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb, if (bdev == NULL) return NULL; + if (bd_claim(bdev, sb)) { + printk(KERN_ERR + "EXT3: failed to claim external journal device.\n"); + blkdev_put(bdev, BDEV_FS); + return NULL; + } + blocksize = sb->s_blocksize; hblock = bdev_hardsect_size(bdev); if (blocksize < hblock) { -- 2.53.0