[LU-4824] lfs find should continue after errors Created: 26/Mar/14  Updated: 18/Aug/14  Resolved: 16/Jun/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.1, Lustre 2.4.3
Fix Version/s: Lustre 2.6.0, Lustre 2.5.3

Type: Bug Priority: Major
Reporter: Matt Ezell Assignee: James Nunez (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-5170 lfs usability Open
Rank (Obsolete): 13263

 Description   

A user has noticed that 'lfs find' stops as soon as it encounters an error, such as EACCES. The regular find command just notes the failure but continues on, returning a non-zero exit code at the end.

# mkdir -p $LUSTREDIR/{dirb,dirc}
# touch $LUSTREDIR/{dirb,dirc}/file1
# sudo chown root:root $LUSTREDIR/dirb
# sudo chmod 700 $LUSTREDIR/dirb
# find $LUSTREDIR -name file1
find: `/lustre/f1/Matthew.Ezell/testdir/dirb': Permission denied
/lustre/f1/Matthew.Ezell/testdir/dirc/file1
# echo $?
1
# lfs find $LUSTREDIR -name file1
llapi_semantic_traverse: Failed to open '/lustre/f1/Matthew.Ezell/testdir/dirb': Permission denied (13)
error: find failed for file1.
# echo $?
22

I created a patch that changes the behavior to the following:

# /tmp/usr/bin/lfs find $LUSTREDIR -name file1
llapi_semantic_traverse: Failed to open '/lustre/f1/Matthew.Ezell/testdir/dirb': Permission denied (13)
/lustre/f1/Matthew.Ezell/testdir/dirc/file1
error: find failed for file1.
# echo $?
1

If you would like, I could change my patch to return EINVAL as it previously did.



 Comments   
Comment by Matt Ezell [ 26/Mar/14 ]

http://review.whamcloud.com/9794

Comment by Matt Ezell [ 16/Jun/14 ]

Patch was landed to master.

I'll test and submit a b2_5 backport soon

Comment by Peter Jones [ 16/Jun/14 ]

Landed for 2.6

Comment by James Nunez (Inactive) [ 14/Jul/14 ]

Patch for b2_5 at: http://review.whamcloud.com/#/c/11093/

Generated at Sat Feb 10 01:46:09 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.