]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
block: remove redundant kill_bdev() call in set_blocksize()
authorYang Xiuwei <yangxiuwei@kylinos.cn>
Tue, 6 Jan 2026 02:42:57 +0000 (10:42 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Feb 2026 16:28:18 +0000 (09:28 -0700)
The second kill_bdev() call in set_blocksize() is redundant as the first
call already clears all buffers and pagecache, and locks prevent new
pagecache creation between the calls.

Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bdev.c

index b8fbb9576110fae0c9fbb49aedfcd5e6a95594c4..ed022f8c48c79c09735ab7bf019629a25bd91f72 100644 (file)
@@ -208,7 +208,6 @@ int set_blocksize(struct file *file, int size)
 
                inode->i_blkbits = blksize_bits(size);
                mapping_set_folio_min_order(inode->i_mapping, get_order(size));
-               kill_bdev(bdev);
                filemap_invalidate_unlock(inode->i_mapping);
                inode_unlock(inode);
        }