Commit 782b94cd authored by Lachlan McIlroy's avatar Lachlan McIlroy Committed by Al Viro

block: initialise bd_super in bdget()

bd_super is currently reset to NULL in kill_block_super() so we rely on previous
users of the block_device object to initialise this value for the next user.
This quirk was exposed on RHEL5 when a third party filesystem did not always use
kill_block_super() and therefore bd_super wasn't being reset when a block_device
object was recycled within the cache.  This may not be a problem upstream but
makes sense to be defensive.
Signed-off-by: default avatarLachlan McIlroy <lmcilroy@redhat.com>
Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c4ae0c65
...@@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev) ...@@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev)
if (inode->i_state & I_NEW) { if (inode->i_state & I_NEW) {
bdev->bd_contains = NULL; bdev->bd_contains = NULL;
bdev->bd_super = NULL;
bdev->bd_inode = inode; bdev->bd_inode = inode;
bdev->bd_block_size = (1 << inode->i_blkbits); bdev->bd_block_size = (1 << inode->i_blkbits);
bdev->bd_part_count = 0; bdev->bd_part_count = 0;
......
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