x86/mm/32: implement arch_sync_kernel_mappings()
[linux-2.6-microblaze.git] / fs / sync.c
index 4d1ff01..c6f6f5b 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -161,7 +161,7 @@ SYSCALL_DEFINE1(syncfs, int, fd)
 {
        struct fd f = fdget(fd);
        struct super_block *sb;
-       int ret;
+       int ret, ret2;
 
        if (!f.file)
                return -EBADF;
@@ -171,8 +171,10 @@ SYSCALL_DEFINE1(syncfs, int, fd)
        ret = sync_filesystem(sb);
        up_read(&sb->s_umount);
 
+       ret2 = errseq_check_and_advance(&sb->s_wb_err, &f.file->f_sb_err);
+
        fdput(f);
-       return ret;
+       return ret ? ret : ret2;
 }
 
 /**