[Linux-cachefs] cachefilesd refuses to cache NFS exports/mounts with fsid = 0
David Härdeman
david at hardeman.nu
Sun May 24 10:48:21 UTC 2020
Hi,
I've been trying to setup fscache for an NFS share by following various online guides but the client refused to enable the FSC for some reason (client = Debian Unstable, Linux 5.6.0; server = Debian Stable, Linux 4.19.0-8).
After a lot of trial and error, I discovered that the caching is enabled as long as the fsid is not zero.
Is this expected behavior and, if so, shouldn't it be documented somewhere?
Cheers,
David
Test summary
============
(root at server:/etc/exports.d)$ cat srv.exports
# Note: /srv is a separate partition
/srv <IPv6 ULA>::/64(sec=krb5:krb5i:krb5p,rw,async,crossmnt,no_subtree_check,root_squash)
(root at server:/etc/exports.d)$ exportfs -ra
(root at client:~)$ mount -t nfs4 server:/ /mnt/tmp -o sec=krb5,fsc
(root at client:~)$ cat /proc/fs/nfsfs/*
NV SERVER PORT USE HOSTNAME
v4 <server IPv6 addr> 801 1 server
NV SERVER PORT DEV FSID FSC
v4 <server IPv6 addr> 801 0:70 0:0 no
(user at client:~)$ cat /mnt/tmp/srv/somedir/somefile.txt &> /dev/null
(root at client:~)$ cat /proc/fs/nfsfs/*
NV SERVER PORT USE HOSTNAME
v4 <server IPv6 addr> 801 1 server
NV SERVER PORT DEV FSID FSC
v4 <server IPv6 addr> 801 0:70 0:0 no
v4 <server IPv6 addr> 801 0:73 7a26f4d97cd54396:9fffb68912b8d546 yes
(root at client:~)$ umount /mnt/tmp
(root at client:~)$ mount -t nfs4 server:/srv /mnt/tmp -o sec=krb5,fsc
(root at client:~)$ cat /proc/fs/nfsfs/*
NV SERVER PORT USE HOSTNAME
v4 <server IPv6 addr> 801 1 server
NV SERVER PORT DEV FSID FSC
v4 <server IPv6 addr> 801 0:73 7a26f4d97cd54396:9fffb68912b8d546 yes
(root at client:~)$ umount /mnt/tmp
(root at server:/etc/exports.d)$ vi srv.exports
(root at server:/etc/exports.d)$ cat srv.exports
# Note: /srv is a separate partition
/srv <IPv6 ULA>::/64(sec=krb5:krb5i:krb5p,rw,async,crossmnt,no_subtree_check,root_squash,fsid=0)
(root at server:/etc/exports.d)$ exportfs -ra
(root at client:~)$ mount -t nfs4 server:/ /mnt/tmp -o sec=krb5,fsc
(root at client:~)$ cat /proc/fs/nfsfs/*
NV SERVER PORT USE HOSTNAME
v4 <server IPv6 addr> 801 1 server
NV SERVER PORT DEV FSID FSC
v4 <server IPv6 addr> 801 0:70 0:0 no
(user at client:~)$ cat /mnt/tmp/somedir/somefile.txt &> /dev/null
(root at client:~)$ cat /proc/fs/nfsfs/*
NV SERVER PORT USE HOSTNAME
v4 <server IPv6 addr> 801 1 server
NV SERVER PORT DEV FSID FSC
v4 <server IPv6 addr> 801 0:70 0:0 no
More information about the Linux-cachefs
mailing list