From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF9B5C433FE for ; Fri, 11 Nov 2022 21:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232943AbiKKVxD (ORCPT ); Fri, 11 Nov 2022 16:53:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231840AbiKKVww (ORCPT ); Fri, 11 Nov 2022 16:52:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E9936B203 for ; Fri, 11 Nov 2022 13:52:51 -0800 (PST) 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 2B865620D5 for ; Fri, 11 Nov 2022 21:52:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34531C433C1; Fri, 11 Nov 2022 21:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668203570; bh=PMd0DjhvSQfkI5UHRqEdF4/hFIa8WjR3+U9A9LWizWY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=pio2lMOjHkp1rT4GmU9mIH8jKJjdYpF62cXgx1OfoGVMXJEzR0/BSB+K78xNPTrP6 7UrvoE5fVuPvK07HZDAhtcrhcO0zUlGhw3hTML0NOhSIf6aeo3WCLt+L7YTmSE7xUU NIReyotj8oUDnsZjX9rKa6kmo95/r3H4bmXPHY4WX081OtdP9FFCCJsF+00faNARWZ ryL47FUu1l5SrGhoML4okjCNEpaDZ+Smz/q68Iah8pFNc6AlwG5v9Pm3o5Ov6pYDIT wnaPHqDF5q6e5R7+G4vjsaWZ1OfFIrogItgYSm4rvxZZhZ1c4jiRcOz9obm/7RA6hw PRjzqMLO6AgaA== Message-ID: <55593a438387aca9187a8a8ea1e0d3c2cc4efb9b.camel@kernel.org> Subject: Re: [PATCH 3/4] lockd: fix file selection in nlmsvc_cancel_blocked From: Jeff Layton To: Chuck Lever III Cc: Trond Myklebust , Linux NFS Mailing List Date: Fri, 11 Nov 2022 16:52:48 -0500 In-Reply-To: <1AE4E7CF-F76B-42E8-90D7-5DA52AFDE66E@oracle.com> References: <20221111193639.346992-1-jlayton@kernel.org> <20221111193639.346992-4-jlayton@kernel.org> <1AE4E7CF-F76B-42E8-90D7-5DA52AFDE66E@oracle.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, 2022-11-11 at 20:29 +0000, Chuck Lever III wrote: >=20 > > On Nov 11, 2022, at 2:36 PM, Jeff Layton wrote: > >=20 > > We currently do a lock_to_openmode call based on the arguments from the > > NLM_UNLOCK call, but that will always set the fl_type of the lock to > > F_UNLCK, the the O_RDONLY descriptor is always chosen. >=20 > Except for the above sentence, these all look sane to me. > I can apply them to nfsd's for-next once they've seen some > review on fsdevel, as you mentioned in the other thread. >=20 >=20 Thanks. That should say "and the O_RDONLY...". Fixed in my tree. I'll go ahead and resend with fsdevel included. > > Fix it to use the file_lock from the block instead. > >=20 > > Signed-off-by: Jeff Layton > > --- > > fs/lockd/svclock.c | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > >=20 > > diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c > > index 9eae99e08e69..4e30f3c50970 100644 > > --- a/fs/lockd/svclock.c > > +++ b/fs/lockd/svclock.c > > @@ -699,9 +699,10 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_= file *file, struct nlm_lock *l > > block =3D nlmsvc_lookup_block(file, lock); > > mutex_unlock(&file->f_mutex); > > if (block !=3D NULL) { > > - mode =3D lock_to_openmode(&lock->fl); > > - vfs_cancel_lock(block->b_file->f_file[mode], > > - &block->b_call->a_args.lock.fl); > > + struct file_lock *fl =3D &block->b_call->a_args.lock.fl; > > + > > + mode =3D lock_to_openmode(fl); > > + vfs_cancel_lock(block->b_file->f_file[mode], fl); > > status =3D nlmsvc_unlink_block(block); > > nlmsvc_release_block(block); > > } > > --=20 > > 2.38.1 > >=20 >=20 > -- > Chuck Lever >=20 >=20 >=20 --=20 Jeff Layton