Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3043082ioo; Sun, 29 May 2022 11:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1q8qGI0RpHgecEa1ImvD/yCwJRMh2FYEOP0rXXvoEixAIxDmO/+gj34NKfO38cHrbWaKv X-Received: by 2002:a05:6402:348f:b0:42b:505a:4ef9 with SMTP id v15-20020a056402348f00b0042b505a4ef9mr40757905edc.66.1653847248767; Sun, 29 May 2022 11:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653847248; cv=none; d=google.com; s=arc-20160816; b=G/lBUGp2k0VKxI8Mbv5omuHgUlFGFFV6XItOfGMNKcXeGioJ9DMnSnIbhoIBQwz/jB ti6ssGGjeBKVued1R7JEMJU8GaVZt457IkBZMSbHW8khPBufkqxuaGNzwQVxJjhLOyht tUgwmar5OMc2eGAfKjdbdpf6PoKsCrcDpJQSCVuIMmm4ZIG6A2YD4RsUpijmyI1mJJkp hsMH7aDzTvxWudYSKUp9mhvOJ2iHGfuOZMncHFODFwvynV+1D1xBpTMs5OA4JZZzhrZT 54pG/v6I9hr0k0g/91lPT29owaYmpahp1UtZF4ZZs88v3m9s8wIfMRqzgYR7WsWFiUTx 5E5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject; bh=eeLo1oxVBZuQ40hZL38GlK3j0V3ejvgO1+06O8QGTBU=; b=tItGH5bNs8exoKMeZr+PQ+edYyMsqyPVf/aIfgvpJATe2SCDBOhajrpvzSK6wJdG3K UURiTXQ6ATlMTwCtS3Dm/acsdynwXvNSeBEBqTU+QA9TD+FcZy2kt7+7hlMhydAWoj/O C+roxM5L4jeYFqU+CpdXyf1vJQHSJDsQcurcjfFjzgR7W94Y/cO5yuGCdqrS/uIfE1iZ FUmc0Zid1Dc+E2vG9iohzzBrNU/jFzsjfB8/yuxi8YPlDo3NuaxHFNZG9HaOuzLgfyqE zGhDiCFkKFMQhLJaHYo8P5PDa3f0ZkFB8YqDAnq1LqiDoV/kZ4UTc2CzVMDT9WsIY31d oJyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a50fc08000000b0042dc0209803si3487711edr.496.2022.05.29.10.59.42; Sun, 29 May 2022 11:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbiE2RHf (ORCPT + 99 others); Sun, 29 May 2022 13:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiE2RHf (ORCPT ); Sun, 29 May 2022 13:07:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC0E11154 for ; Sun, 29 May 2022 10:07:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C653060F70 for ; Sun, 29 May 2022 17:07:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06574C385A9; Sun, 29 May 2022 17:07:32 +0000 (UTC) Subject: [PATCH] nfsv4.0/release-lockowner: Check for proper LOCKS_HELD response From: Chuck Lever To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Date: Sun, 29 May 2022 13:07:31 -0400 Message-ID: <165384405174.3290283.7508180988614656582.stgit@morisot.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Ensure that RELEASE_LOCKOWNER returns LOCKS_HELD if the lockowner is still in use. Signed-off-by: Chuck Lever --- nfs4.0/servertests/st_releaselockowner.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nfs4.0/servertests/st_releaselockowner.py b/nfs4.0/servertests/st_releaselockowner.py index 2c83f99b207f..b296e6c2752a 100644 --- a/nfs4.0/servertests/st_releaselockowner.py +++ b/nfs4.0/servertests/st_releaselockowner.py @@ -49,3 +49,24 @@ def testFile2(t, env): owner = lock_owner4(c.clientid, b"lockowner_RLOWN2") res = c.compound([op.release_lockowner(owner)]) check(res) + +def testLocksHeld(t, env): + """RELEASE_LOCKOWNER - Locks held test + + FLAGS: releaselockowner all + DEPEND: + CODE: RLOWN3 + """ + c = env.c1 + c.init_connection() + fh, stateid = c.create_confirm(t.word()) + res = c.lock_file(t.word(), fh, stateid, lockowner=b"lockowner_RLOWN3") + check(res) + owner = lock_owner4(c.clientid, b"lockowner_RLOWN3") + res2 = c.compound([op.release_lockowner(owner)]) + check(res2, NFS4ERR_LOCKS_HELD) + res = c.unlock_file(1, fh, res.lockid) + check(res) + owner = lock_owner4(c.clientid, b"lockowner_RLOWN3") + res = c.compound([op.release_lockowner(owner)]) + check(res)