Skip to content
Commit 644140ef authored by Russell King's avatar Russell King Committed by Will Deacon
Browse files

virtio: fix fsync() on a directory



dpkg in the guest fails when it tries to use fsync() on a directory:

openat(AT_FDCWD, "/var/lib/dpkg", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
fsync(4)                                = -1 EINVAL (Invalid argument)

stracing lkvm shows that this is converted to:

openat(AT_FDCWD, "/root/rootfs-32//var/lib/dpkg", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 368
fsync(0)                = -1 EINVAL (Invalid argument)

In other words, we sync against the wrong file descriptor.  This case
is not handled in the kvmtool code, let's add support for it.

Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent edb4a8a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment