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>
This commit is contained in:
Kent Overstreet 2024-05-08 17:33:29 -04:00
parent 99179fb898
commit d09a8468d9

View 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: */