diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 23:33:29 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-09 22:23:36 +0200 |
commit | d09a8468d915850709ae5f34c23e2b24cb5c3c62 (patch) | |
tree | 8e890f9469ffb7904693c0b13b5a21964d6c725b /fs | |
parent | bcachefs: Invalid devices are now checked for by fsck, not .invalid methods (diff) | |
download | linux-d09a8468d915850709ae5f34c23e2b24cb5c3c62.tar.xz linux-d09a8468d915850709ae5f34c23e2b24cb5c3c62.zip |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/fs-io.c | 5 |
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: */ |