Fix broken inode removal again (ACCESS will now allow root access to such inodes)
This commit is contained in:
@@ -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());
|
fprintf(stderr, "[%d] ACCESS %ju -> %s\n", self->nfs_fd, ino, value.c_str());
|
||||||
if (res < 0)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -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
|
sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp
|
||||||
ls -l ./testdata/nfs
|
ls -l ./testdata/nfs
|
||||||
ls -l ./testdata/nfs/settings.jsonLGNmGn
|
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)'
|
build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)'
|
||||||
ls -l ./testdata/nfs
|
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
|
sudo mount localhost:/ ./testdata/nfs -o port=2050,mountport=2050,nfsvers=3,soft,nolock,tcp
|
||||||
ls -l ./testdata/nfs
|
ls -l ./testdata/nfs
|
||||||
ls -l ./testdata/nfs/settings.jsonLGNmGn
|
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)'
|
build/src/kv/vitastor-kv --etcd_address $ETCD_URL fsmeta get d11/settings.jsonLGNmGn 2>&1 | grep '(code -2)'
|
||||||
ls -l ./testdata/nfs
|
ls -l ./testdata/nfs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user