fusefrontend: honor ForceOwner for LOOKUP and CREATE operations

This commit is contained in:
Charles Duffy 2021-10-08 20:54:41 +00:00 committed by Jakob Unterwurzacher
parent 3b881b0174
commit 8ec872e330
2 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,10 @@ func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (ch
n.translateSize(dirfd, cName, &out.Attr) n.translateSize(dirfd, cName, &out.Attr)
rn := n.rootNode() rn := n.rootNode()
if rn.args.ForceOwner != nil {
out.Owner = *rn.args.ForceOwner
}
if rn.args.SharedStorage { if rn.args.SharedStorage {
// If we already have a child node that matches what we found on disk* // If we already have a child node that matches what we found on disk*
// (as reflected in `ch`), return it here. // (as reflected in `ch`), return it here.

View File

@ -103,6 +103,12 @@ func (n *Node) Create(ctx context.Context, name string, flags uint32, mode uint3
if errno != 0 { if errno != 0 {
return return
} }
inode = n.newChild(ctx, st, out) inode = n.newChild(ctx, st, out)
if rn.args.ForceOwner != nil {
out.Owner = *rn.args.ForceOwner
}
return inode, fh, fuseFlags, errno return inode, fh, fuseFlags, errno
} }