Re: [PATCH v7] block: avoid long sync_blockdev() under disk->open_mutex during parallel close
From: kernel test robot
Date: Sun Oct 18 2026 - 22:30:18 EST
Hi Tetsuo,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe/for-next]
[also build test WARNING on linus/master v7.3 next-20261016]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Tetsuo-Handa/block-avoid-long-sync_blockdev-under-disk-open_mutex-during-parallel-close/20261017-004014
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/6efed2d0-fe66-4d29-876b-fd3b74abaa70%40I-love.SAKURA.ne.jp
patch subject: [PATCH v7] block: avoid long sync_blockdev() under disk->open_mutex during parallel close
config: um-x86_64_defconfig (https://download.01.org/0day-ci/archive/20261019/202610191027.uw2yfQhY-lkp@xxxxxxxxx/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 6719b9e31d6a93099612c474eec76d9f41d0275a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261019/202610191027.uw2yfQhY-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610191027.uw2yfQhY-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
>> block/bdev.c:1157:3: warning: releasing mutex 'disk->open_mutex' that was not held [-Wthread-safety-analysis]
1157 | mutex_unlock(&disk->open_mutex);
| ^
>> block/bdev.c:1162:1: warning: mutex 'disk->open_mutex' is not held on every path through here [-Wthread-safety-analysis]
1162 | }
| ^
block/bdev.c:1159:3: note: mutex acquired here
1159 | mutex_lock(&disk->open_mutex);
| ^
2 warnings generated.
vim +1157 block/bdev.c
1152
1153 static inline void bd_early_sync(struct gendisk *disk, struct block_device *bdev)
1154 {
1155 if (atomic_read(&bdev->bd_openers) == 1 + bdev->bd_closers) {
1156 bdev->bd_closers++;
> 1157 mutex_unlock(&disk->open_mutex);
1158 sync_blockdev(bdev);
1159 mutex_lock(&disk->open_mutex);
1160 bdev->bd_closers--;
1161 }
> 1162 }
1163
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki