[LU-8731] lfs df exits with status 0 on failures Created: 19/Oct/16  Updated: 20/Jan/17  Resolved: 29/Oct/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.9.0
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Major
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: test

Issue Links:
Related
is related to LU-8544 recovery-double-scale test_pairwise_f... Resolved
is related to LU-7759 umount hanging in modern distros when... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In lfs.c the mntdf() function does not propagate errors from llapi_obd_statfs(). In fact it always returns 0 (except when an invalid pool is specified). This means that 'lfs df' will not fail in some cases that it probably should. For example in the following case

# lfs df /mnt/lustre
UUID                   1K-blocks        Used   Available Use% Mounted on
lustre-MDT0000_UUID : Input/output error
lustre-MDT0001_UUID       125368        1692      114316   1% /mnt/lustre[MDT:1]
error: llapi_obd_statfs: opening '/mnt/lustre': Cannot send after transport endpoint shutdown (108)
lustre-OST0000_UUID       350360       13900      316988   4% /mnt/lustre[OST:0]
lustre-OST0001_UUID       350360       13904      316984   4% /mnt/lustre[OST:1]

filesystem summary:       700720       27804      633972   4% /mnt/lustre
# echo $?
0

Importantly this also means that the lfs_df_check() function from test-framework.sh which is used by client_up() and clients_up() is broken:

lfs_df_check() {
        local clients=${1:-$CLIENTS}

	if [ -z "$clients" ]; then
                $LFS df $MOUNT
        else
                $PDSH $clients "$LFS df $MOUNT" > /dev/null
        fi
}

clients_up() {
        # not every config has many clients
        sleep 1
        lfs_df_check
}

client_up() {
        # usually checked on particular client or locally
        sleep 1
	lfs_df_check $1
}


 Comments   
Comment by Gerrit Updater [ 20/Oct/16 ]

John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23286
Subject: LU-8731 utils: propagate errors in lfs df
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b01039eb79ce652f3d7724ffbb41be2151591b2d

Comment by Gerrit Updater [ 28/Oct/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23286/
Subject: LU-8731 utils: propagate errors in lfs df
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: bfd4600f31691fdad676a8489f591bccc24f2100

Comment by Peter Jones [ 29/Oct/16 ]

Landed for 2.9

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