]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: fsync() should not return -EROFS
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:33:29 +0000 (17:33 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 9 May 2024 20:23:36 +0000 (16:23 -0400)
fsync has a slightly odd usage of -EROFS, where it means "does not
support fsync". I didn't choose it...

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io.c

index 442bcb0793c412787c33ab3ba29581dd2087608a..ef20b64033e09953bea9160ec8aeed8434058f79 100644 (file)
@@ -202,7 +202,10 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
                goto out;
        ret = bch2_flush_inode(c, inode);
 out:
-       return bch2_err_class(ret);
+       ret = bch2_err_class(ret);
+       if (ret == -EROFS)
+               ret = -EIO;
+       return ret;
 }
 
 /* truncate: */