Fix broken inode removal again (ACCESS will now allow root access to such inodes)

This commit is contained in:
Vitaliy Filippov
2025-11-29 19:30:20 +03:00
parent 8aa2c49202
commit 76c7c26d32
2 changed files with 16 additions and 3 deletions
+14 -1
View File
@@ -166,7 +166,20 @@ int kv_nfs3_access_proc(void *opaque, rpc_op_t *rop)
fprintf(stderr, "[%d] ACCESS %ju -> %s\n", self->nfs_fd, ino, value.c_str());
if (res < 0)
{
*reply = (ACCESS3res){ .status = vitastor_nfs_map_err(-res) };
// Broken inode (non-existing), allow only root access
if (!rop->auth_sys.uid)
{
*reply = (ACCESS3res){
.status = NFS3_OK,
.resok = (ACCESS3resok){
.access = args->access,
},
};
}
else
{
*reply = (ACCESS3res){ .status = vitastor_nfs_map_err(-res) };
}
}
else
{
+2 -2
View File
@@ -179,7 +179,7 @@ build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta set d11/settings.jsonLG
sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp
ls -l ./testdata/nfs
ls -l ./testdata/nfs/settings.jsonLGNmGn
rm ./testdata/nfs/settings.jsonLGNmGn
sudo rm ./testdata/nfs/settings.jsonLGNmGn
build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)'
ls -l ./testdata/nfs
@@ -189,7 +189,7 @@ build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta set d11/settings.jsonLG
sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp
ls -l ./testdata/nfs
ls -l ./testdata/nfs/settings.jsonLGNmGn
rm ./testdata/nfs/settings.jsonLGNmGn
sudo rm ./testdata/nfs/settings.jsonLGNmGn
build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)'
ls -l ./testdata/nfs