VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Maxim Patlasov <mpatlasov@virtuozzo.com> 2016-07-19 18:12:26 -0700 committer: Miklos Szeredi <mszeredi@redhat.com> 2016-07-29 14:10:57 +0200 commit: 9ebce595f63a407c5cec98f98f9da8459b73740a parent: ac7f052b9e1534c8248f814b6f0068ad8d4a06d2
Commit Summary:
fuse: fuse_flush must check mapping->flags for errors
Diffstat:
1 file changed, 9 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 2491f388358b..594fb15fba9b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -417,6 +417,15 @@ static int fuse_flush(struct file *file, fl_owner_t id)
 	fuse_sync_writes(inode);
 	inode_unlock(inode);
 
+	if (test_bit(AS_ENOSPC, &file->f_mapping->flags) &&
+	    test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags))
+		err = -ENOSPC;
+	if (test_bit(AS_EIO, &file->f_mapping->flags) &&
+	    test_and_clear_bit(AS_EIO, &file->f_mapping->flags))
+		err = -EIO;
+	if (err)
+		return err;
+
 	req = fuse_get_req_nofail_nopages(fc, file);
 	memset(&inarg, 0, sizeof(inarg));
 	inarg.fh = ff->fh;