diff options
author | Lachlan McIlroy <lmcilroy@redhat.com> | 2011-06-29 21:01:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-08-01 01:57:44 -0400 |
commit | 782b94cdf577b4df1feb376f372dccc28e66a771 (patch) | |
tree | e0ea0054539a695707f4e54aacdb0c53cd990076 /fs/block_dev.c | |
parent | c4ae0c65455c1bb30d1b71c6dd9a1a62aadde8ef (diff) |
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: Lachlan McIlroy <lmcilroy@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index f55aad4d1611..f28680553288 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev) | |||
552 | 552 | ||
553 | if (inode->i_state & I_NEW) { | 553 | if (inode->i_state & I_NEW) { |
554 | bdev->bd_contains = NULL; | 554 | bdev->bd_contains = NULL; |
555 | bdev->bd_super = NULL; | ||
555 | bdev->bd_inode = inode; | 556 | bdev->bd_inode = inode; |
556 | bdev->bd_block_size = (1 << inode->i_blkbits); | 557 | bdev->bd_block_size = (1 << inode->i_blkbits); |
557 | bdev->bd_part_count = 0; | 558 | bdev->bd_part_count = 0; |