From 6523575472cbebff4ccd9c80f65e814c60919c41 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 16 Nov 2011 00:04:57 +0000 Subject: [PATCH] Fixes reporting to BLOCKIO devices fsync() errors, noticed by Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3922 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 457191282..cfaea5789 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -2661,7 +2661,7 @@ static int vdisk_fsync(struct scst_vdisk_thr *thr, loff_t loff, if (virt_dev->blockio) { res = vdisk_blockio_flush(thr->bdev, gfp_flags, true); - goto out; + goto out_check; } file = thr->fd; @@ -2676,6 +2676,8 @@ static int vdisk_fsync(struct scst_vdisk_thr *thr, loff_t loff, res = filemap_write_and_wait_range(file->f_mapping, loff, len); #endif #endif + +out_check: if (unlikely(res != 0)) { PRINT_ERROR("sync range failed (%d)", res); if (cmd != NULL) {