From: Kent Overstreet Date: Wed, 8 May 2024 21:33:29 +0000 (-0400) Subject: bcachefs: fsync() should not return -EROFS X-Git-Tag: v6.10-rc1~99^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d09a8468d915850709ae5f34c23e2b24cb5c3c62;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 442bcb0793c41..ef20b64033e09 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: */