HomeFreeBSD

Fix fuse for "cp" of a mode 0444 file to the file system.

Description

Fix fuse for "cp" of a mode 0444 file to the file system.

When "cp" of a file with read-only (mode 0444) to a fuse mounted
file system was attempted it would fail with EACCES. This was because
fuse would attempt to open the file WRONLY and the open would fail.
This patch changes the fuse_vnop_open() to test for an extant read-write
open and use that, if it is available.
This makes the "cp" of a read-only file to the fuse mounted file system
work ok.
There are simpler ways to fix this than adding the fuse_filehandle_validrw()
function, but this function is useful for future patches related to
exporting a fuse filesystem via NFS.

MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on
Parents
rS299871: Add Allwinner A83T thermal sensor controller support.
Branches
Unknown
Tags
Unknown