Commit 9907e736 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3: bd_claim for journal device

From: Neil Brown <neilb@cse.unsw.edu.au>

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.
parent 1fcec52f
......@@ -340,6 +340,7 @@ static struct block_device *ext3_blkdev_get(dev_t dev)
*/
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment