A recent libbcachefs update accidentally committed a change that dropped
the O_DIRECT flag - we definitely didn't want to do that.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
if (buffered_fd < 0)
return ERR_PTR(-errno);
- fd = open(path, flags);
+ fd = open(path, flags|O_DIRECT);
if (fd < 0)
fd = dup(buffered_fd);
if (fd < 0) {
return ERR_PTR(-errno);
}
- sync_fd = open(path, flags|O_SYNC);
+ sync_fd = open(path, flags|O_DIRECT|O_SYNC);
if (sync_fd < 0)
sync_fd = open(path, flags|O_SYNC);
if (sync_fd < 0) {