From: davej@codemonkey.org.uk We currently run sync_blockdev() on every close of a blockdev. This patch arranges for the sync to happen only on the final close. fs/block_dev.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff -puN fs/block_dev.c~sync_blockdev-on-final-close fs/block_dev.c --- 25/fs/block_dev.c~sync_blockdev-on-final-close 2003-03-24 10:17:16.000000000 -0800 +++ 25-akpm/fs/block_dev.c 2003-03-24 10:17:16.000000000 -0800 @@ -653,15 +653,16 @@ int blkdev_put(struct block_device *bdev struct gendisk *disk = bdev->bd_disk; down(&bdev->bd_sem); - switch (kind) { - case BDEV_FILE: - case BDEV_FS: - sync_blockdev(bd_inode->i_bdev); - break; - } lock_kernel(); - if (!--bdev->bd_openers) + if (!--bdev->bd_openers) { + switch (kind) { + case BDEV_FILE: + case BDEV_FS: + sync_blockdev(bd_inode->i_bdev); + break; + } kill_bdev(bdev); + } if (bdev->bd_contains == bdev) { if (disk->fops->release) ret = disk->fops->release(bd_inode, NULL); _