Skip to content

Commit 782b94c

Browse files
Lachlan McIlroyAl Viro
authored andcommitted
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>
1 parent c4ae0c6 commit 782b94c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/block_dev.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ struct block_device *bdget(dev_t dev)
552552

553553
if (inode->i_state & I_NEW) {
554554
bdev->bd_contains = NULL;
555+
bdev->bd_super = NULL;
555556
bdev->bd_inode = inode;
556557
bdev->bd_block_size = (1 << inode->i_blkbits);
557558
bdev->bd_part_count = 0;

0 commit comments

Comments
 (0)