main: reset O_DIRECT on open

having the fd open with O_DIRECT causes pwrite64 to fail with EINVAL
if the write buffer is not aligned.  Since we have no control on the
buffer provided by libfuse, just drop O_DIRECT.

Closes: https://github.com/containers/fuse-overlayfs/issues/167

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-01-14 12:26:22 +01:00
parent ffc83a4ed6
commit 724ab6d2b3
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

2
main.c
View File

@ -3149,6 +3149,8 @@ ovl_do_open (fuse_req_t req, fuse_ino_t parent, const char *name, int flags, mod
flags |= O_NOFOLLOW;
flags &= ~O_DIRECT;
if (lo->writeback)
{
if ((flags & O_ACCMODE) == O_WRONLY)