Message ID | 20180518123415.28181-12-jlayton@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/include/linux/fs.h b/include/linux/fs.h index fecd29325f36..1ff9d4d119cb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2505,9 +2505,18 @@ extern const struct file_operations def_chr_fops; static inline int call_sync_fs(struct super_block *sb, int wait, errseq_t *since) { + int ret; + if (sb->s_op->sync_fs) return sb->s_op->sync_fs(sb, wait, since); - return __sync_blockdev(sb->s_bdev, wait); + + ret = __sync_blockdev(sb->s_bdev, wait); + if (since) { + int ret2 = errseq_check_and_advance(&sb->s_wb_err, since); + if (ret == 0) + ret = ret2; + } + return ret; } #ifdef CONFIG_BLOCK