CHROMIUM: fuse: Set SB_NOSEC for virtiofs

Currently when caching is enabled the fuse driver sends a getxattr
request for every write request to see if the security.capability xattr
is set.  This adds a significant amount of latency to every write
operation.  However, the kernel provides a flag that can be set on the
file system superblock (SB_NOSEC) that effectively allows the kernel to
cache the value of the xattr.  This is disabled by default for fuse.

Enable SB_NOSEC for virtiofs.  This requires making some assumptions
that we know are true for virtiofs but may not be true for generic fuse
servers.  The proper fix is being worked on upstream (the latest patch
series is [1]) so this is just a temporary solution until the upstream
fix can be backported.

BUG=b:163383485
TEST=`fio --ioengine=libaio --direct=1  --name=test --filename=$FILENAME
     --bs=4k --iodepth=64 --size=4G --readwrite=randwrite`
     Without this change the fio benchmark gives a write bandwidth of
     26 MiB/s.  With this change the fio benchmark gives a write
     bandwidth of 194 MiB/s, which is a very significant improvement.

[1]: https://lore.kernel.org/linux-fsdevel/20201009181512.65496-1-vgoyal@redhat.com/

Change-Id: I074b009c122a3abeccdb7e23beae284b6ec3d3ec
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2486004
Reviewed-by: Suleiman Souhlal <suleiman@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
3 files changed