Skip to content

Commit

Permalink
block: initialise bd_super in bdget()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Sandeen <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Lachlan McIlroy authored and Al Viro committed Aug 1, 2011
1 parent c4ae0c6 commit 782b94c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev)

if (inode->i_state & I_NEW) {
bdev->bd_contains = NULL;
bdev->bd_super = NULL;
bdev->bd_inode = inode;
bdev->bd_block_size = (1 << inode->i_blkbits);
bdev->bd_part_count = 0;
Expand Down

0 comments on commit 782b94c

Please sign in to comment.