[LU-13843] removing non existing path with lctl pcc del returns 0 (success) exit code without error message Created: 31/Jul/20  Updated: 05/Aug/20  Resolved: 05/Aug/20

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.14.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Vikentsi Lapa Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: PCC

Issue Links:
Related
is related to LU-10499 Readonly Persistent Client Cache support Closed
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

 

 

Steps to reproduce:

 

Check that cache is not configured. Empty list.

  1. lctl pcc list /mnt/lustre

#

 

Try to delete any cache

  1. lctl pcc del /mnt/lustre /mnt/pccro/
  1. echo $?

0

 

Try for any word

  1. lctl pcc del /mnt/lustre abc
  1. echo $?

0

 

This is not critical, but it is good to have proper return codes for scripting or control that this is expected.



 Comments   
Comment by Qian Yingjin [ 03/Aug/20 ]

I tried the test in my local system, It reported errors as expected.

[root@qian tests]# ../utils/lctl pcc add /mnt/lustre /mnt/pcc -p "projid={100} rwid=2"

[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /mnt/pcc2 || echo $?
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del /mnt/pcc2': No such file or directory (2)
2
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /mnt/pcc2           
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del /mnt/pcc2': No such file or directory (2)
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /kkk     
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del /kkk': No such file or directory (2)
[root@qian tests]# echo $?
2
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre abc 
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del abc': Invalid argument (22)
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /mnt/pcc
[root@qian tests]# echo $?
0
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /mnt/pcc
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del /mnt/pcc': No such file or directory (2)
[root@qian tests]# ../utils/lctl pcc list /mnt/lustre         
[root@qian tests]# ../utils/lctl pcc del /mnt/lustre /mnt/pcc
lctl pcc pcc: error: setting llite.lustre-ffff9ebf38692800.pcc='del /mnt/pcc': No such file or directory (2)
[root@qian tests]# 

Comment by Vikentsi Lapa [ 03/Aug/20 ]

I am using  versions below for test, can you provide your build version?

rpm -qa | grep lustre
kmod-lustre-client-2.13.55_3_gaaa3279-1.el7.x86_64
lustre-client-2.13.55_3_gaaa3279-1.el7.x86_64
lustre-iokit-2.13.55_3_gaaa3279-1.el7.x86_64
lustre-client-tests-2.13.55_3_gaaa3279-1.el7.x86_64

1. Check that something attached to the cache

lctl pcc list /mnt/lustre
pcc:
-
pccpath: /mnt/pccro_tst
hsmtool: posix
rwid: 5
roid: 5
flags: 3e
autocache: projid={100}
-
pccpath: /mnt/pccro
hsmtool: posix
rwid: 4
roid: 4
flags: 3e
autocache: projid={100}

2.  Than check delete option

[root@trevis-59vm12 ~]# lctl pcc del /mnt/lustre abc
[root@trevis-59vm12 ~]# echo $?
0

Comment by Qian Yingjin [ 04/Aug/20 ]

This bug was introduced in LU-12373. The patch I tested was https://review.whamcloud.com/#/c/38305/.

I have fixed this bug in 

https://review.whamcloud.com/38352 LU-12373 pcc: uncache the pcc copies when remove a PCC backend

Please try again!

 

Thanks,

Qian

Comment by Vikentsi Lapa [ 05/Aug/20 ]

Verified with lustre-2.13.55_3_g066eec1-1.el7.x86_64

# lctl pcc del /mnt/lustre abc
del: failed to delete 'abc' on '/mnt/lustre': No such file or directory
[root@trevis-59vm9 ~]# echo $?
2

 

Generated at Sat Feb 10 03:04:42 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.