blkdev_issue_flush() may fail (i.e. due to media error on FLUSH CACHE command execution) so its users should check for the return value. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx> --- fs/reiserfs/file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: b/fs/reiserfs/file.c =================================================================== --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -140,14 +140,18 @@ static int reiserfs_sync_file(struct fil struct inode *p_s_inode = p_s_dentry->d_inode; int n_err; int barrier_done; + int tmp_ret; BUG_ON(!S_ISREG(p_s_inode->i_mode)); n_err = sync_mapping_buffers(p_s_inode->i_mapping); reiserfs_write_lock(p_s_inode->i_sb); barrier_done = reiserfs_commit_for_inode(p_s_inode); reiserfs_write_unlock(p_s_inode->i_sb); - if (barrier_done != 1 && reiserfs_barrier_flush(p_s_inode->i_sb)) - blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL); + if (barrier_done != 1 && reiserfs_barrier_flush(p_s_inode->i_sb)) { + tmp_ret = blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL); + if (n_err == 0 && tmp_ret < 0 && tmp_ret != -EOPNOTSUPP) + n_err = tmp_ret; + } if (barrier_done < 0) return barrier_done; return (n_err < 0) ? -EIO : 0; -- To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html