gfs2: convert to errseq_t based writeback error reporting for fsync
authorJeff Layton <jlayton@redhat.com>
Fri, 7 Jul 2017 19:20:53 +0000 (15:20 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 1 Aug 2017 12:39:29 +0000 (08:39 -0400)
Also, fix a place where a writeback error might get dropped in the
gfs2_is_jdata case.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
fs/gfs2/file.c

index c2062a108d19602544276f596de75b1f593a1e61..c53ac6efd04c5e299d34f857697ddc81debbda14 100644 (file)
@@ -668,12 +668,14 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
                if (ret)
                        return ret;
                if (gfs2_is_jdata(ip))
-                       filemap_write_and_wait(mapping);
+                       ret = file_write_and_wait(file);
+               if (ret)
+                       return ret;
                gfs2_ail_flush(ip->i_gl, 1);
        }
 
        if (mapping->nrpages)
-               ret = filemap_fdatawait_range(mapping, start, end);
+               ret = file_fdatawait_range(file, start, end);
 
        return ret ? ret : ret1;
 }