Skip to content

Commit d09a846

Browse files
author
Kent Overstreet
committed
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>
1 parent 99179fb commit d09a846

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/bcachefs/fs-io.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
202202
goto out;
203203
ret = bch2_flush_inode(c, inode);
204204
out:
205-
return bch2_err_class(ret);
205+
ret = bch2_err_class(ret);
206+
if (ret == -EROFS)
207+
ret = -EIO;
208+
return ret;
206209
}
207210

208211
/* truncate: */

0 commit comments

Comments
 (0)