[LU-17408] Calling "lfs setquota" during a barrier_freeze causes subsequent barrier_freeze to fail Created: 09/Jan/24  Updated: 17/Jan/24

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Jeya Ganesh Babu Jegatheesan Assignee: Jeya Ganesh Babu Jegatheesan
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

If a "lfs setquota" command is run on a mounted filesystem when a barrier_freeze has been placed, then subsequent barrier_freeze commands fail.

The issue seems to be in the mdt_quotactl where the order of the barrier apis are reversed - https://git.whamcloud.com/?p=fs/lustre-release.git;a=blob;f=lustre/mdt/mdt_handler.c;h=1feb91a1ca4157b61092f0e3db0dde2fd188c44d;hb=HEAD#l3361

The barrier_exit is called first and then a barrier entry is called. During a barrier_freeze, the barrier_exit succeeds, but the barrier_entry fails and causes the barrier counter to go negative.

The below sanity.sh test would help to recreate the issue

test_801d() {
        prep_801

        # 180 seconds should be long enough
        do_facet mgs $LCTL barrier_freeze $FSNAME 60

        b_status=$(barrier_stat)
        [ "$b_status" = "'frozen'" ] ||
                error "(1) unexpected barrier status $b_status"

        $LFS setquota -u 1000 -i 10000 $DIR

        sleep 5

        do_facet mgs $LCTL barrier_thaw $FSNAME
        b_status=$(barrier_stat)
        [ "$b_status" = "'thawed'" ] ||
                error "(2) unexpected barrier status $b_status"

        # Should be able to freeze again
        do_facet mgs $LCTL barrier_freeze $FSNAME 30
        b_status=$(barrier_stat)
        [ "$b_status" = "'frozen'" ] ||
                error "(3) unexpected barrier status $b_status"

        do_facet mgs $LCTL barrier_thaw $FSNAME
        b_status=$(barrier_stat)
        [ "$b_status" = "'thawed'" ] ||
                error "(2) unexpected barrier status $b_status"
        post_801
}
run_test 801d "Barrier freeze with setquota" 

 



 Comments   
Comment by Gerrit Updater [ 17/Jan/24 ]

"Jeya ganesh babu <jeyaga@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53722
Subject: LU-17408 mdt: Fix the order of barrier calls
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: da93eaeccbbeb109aabf9a71ef167388e1783994

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