block: take bd_mutex around delete_partitions in del_gendisk
mainline inclusion from mainline-v5.13-rc1 commit c76f48eb category: bugfix bugzilla: 168631 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c76f48eb5c084b1e15c931ae8cc1826cd771d70d -------------------------------- There is nothing preventing an ioctl from trying do delete partition concurrenly with del_gendisk, so take open_mutex to serialize against that. Signed-off-by: NChristoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210406062303.811835-6-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk> Conflict: block/genhd.c block/partitions/core.c [yufen: del_gendisk didn't call blk_drop_partitions().] Signed-off-by: NYufen Yu <yuyufen@huawei.com> Reviewed-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录