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
This commit is contained in:
Vladislav Bolkhovitin
2011-11-16 00:04:57 +00:00
parent 1e547f1aae
commit 6523575472
+3 -1
View File
@@ -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) {