summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:33:29 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-10 09:27:23 -0400
commit9f0bdd82417c55f6988c14e80d42667712d3d3ea (patch)
tree7d8d3882477b52ace0456f925ac6bb56651a761d
parentdf5e40279aaf02a3a2a56e86b32a09b4416a2797 (diff)
bcachefs: fsync() should not return -EROFS
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>
-rw-r--r--fs/bcachefs/fs-io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 442bcb0793c4..ef20b64033e0 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -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: */