Skip to content

Commit

Permalink
nfs-vfs: fix access check in ChimeraVfs (fixes 19fa7cf)
Browse files Browse the repository at this point in the history
Motivation:
the change 19fa7cf introduced a check `isRoot` for all files,
however, the original code was performing such check only for special
files.

Modification:
Ensure that `isRoot` check performed only if inode type is SURI.

Result:
fixes unexpected exception.

Acked-by: Lea Morschel
Acked-by: Paul Millar
Acked-by: Dmitry Litvintsev
Target: master, 7.2, 7.1, 7.0
Require-book: no
Require-notes: yes
(cherry picked from commit bfcf3a3)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
  • Loading branch information
kofemann authored and mksahakyan committed Oct 25, 2021
1 parent 9fe968d commit 5a2202f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -496,7 +496,7 @@ public int access(Inode inode, int mode) throws IOException {
@VisibleForTesting
static boolean shouldRejectUpdates(FsInode fsInode, FileSystemProvider fs)
throws ChimeraFsException {
if (!isRoot() && fsInode.type() == FsInodeType.SURI) {
if (fsInode.type() == FsInodeType.SURI && !isRoot()) {
return !fs.getInodeLocations(fsInode, StorageGenericLocation.TAPE).isEmpty();
}
return false;
Expand Down

0 comments on commit 5a2202f

Please sign in to comment.