Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3600665imw; Mon, 11 Jul 2022 11:46:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1utfy48AtSml8p6ZcadcVNSwSsKeFFUM47HyWGt/Wy6CghzO16Pdi8ucdDW0JWUITICJDgw X-Received: by 2002:a63:5a21:0:b0:3fd:41e4:f833 with SMTP id o33-20020a635a21000000b003fd41e4f833mr17095621pgb.409.1657565212922; Mon, 11 Jul 2022 11:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657565212; cv=none; d=google.com; s=arc-20160816; b=mS9PLVAceEcurH0+khGKOrHdYYRGIwDrcsIEPml9pQpWXWDU2vTwzLjdXHe0+bCCeQ BdQttBM3ocI3y9+uHWRs1NXA6Cg/ewFA1ZrUr2kweojPSB43/719UZgwxW1dbbu/jvZF K2RCx6crifbR7u0pvemLe9dXrc3LMbozrbeQTE/5cujhYaOuBRzt5iX2y2gDAyj7QYZW TzakDktMwvLi5bTGgDv3xWN0WJbZ1Wj/Ed4G+gbSwBxw9SpLCnfKHA+Co0HPT/S8ubiE k5XV6l6fu1jHDb6vSqmoLIfZ8QBAmbzOITH87X1TGBrt4aOAAs2pf/f6t2CAP0oxzTL2 BKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=B2JaPQnqGAbGl+20zYAJQtO24wh+nL+ePkBVtBNXH2E=; b=OX5+wEyAJI/VArJSiRyDB8HN4s36DxlnEbann2+Zh6w63FtLeSwR6MNSpMLF8kV3df ziDAndnKcWazuPG8X1+BAp+7nXkccrlpMg4mmgLZsxfpvXhy0UXemv2BLnwDYK9BR0zQ lhIGzqX8gY1ZUXq+IvTdyF4chGjnBIMc19MtGEWzFosIv/L+tMsQ6w1tfkacUILJnACZ z0azWSInMqdR4HU822tpLbIllLVmGNjcqEuP7a+WkFjoO7yUCJqdzEhTK17K4Eox0zGP h+iqUmkeZhwK4K2pHiPGZO6OSAnZeXxaMvEJVJbJFK10H1JiCNMb8Iq9E7z1xk7hwPrl hn4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Uf0UZZD+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170902f15100b0016a6b9c2b5csi8724299plb.234.2022.07.11.11.46.39; Mon, 11 Jul 2022 11:46:52 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Uf0UZZD+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbiGKSg4 (ORCPT + 99 others); Mon, 11 Jul 2022 14:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbiGKSgz (ORCPT ); Mon, 11 Jul 2022 14:36:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971ED5FAF9 for ; Mon, 11 Jul 2022 11:36:53 -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 295AE61502 for ; Mon, 11 Jul 2022 18:36:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0EB3C34115; Mon, 11 Jul 2022 18:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657564612; bh=4edvnMtVk3QBa8TySw2kNqkOSMq1ohv1OhZiSxfCgS4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Uf0UZZD+nHBeDRiypw5GhTDC0d3tPHDQwz6EC64HWILwa/nx1+qg1C/rBbWT3LHIo Oi29oaY6zfBzW141FeetHn7lIXJlIUB5lAoYX7uuYcp71iRmAhkXtpIYkGwuw/Re89 JM9f/3x2ALa5j5oVB4+0GlNQxQpVAzds10lYCGjyxrtdf5wehsNo1RsoR6vhwnWtz8 H1YpcBoJ54wvxFkjOqX9qIGJ3fZ9RDnq/bQ2lhrarCBSrDfDMo4Tf7AjLj4Wfsdtrw TAysopfgnovtZUlC5/wZ6nOsnrXBUV1Ruas2/oFaK3yuSMHqInfG1Me8OHnc7FAb2A wNixZg0RreWwA== Message-ID: <60ea4a58791290d479024baab54d384a49181ede.camel@kernel.org> Subject: Re: [PATCH 1/2] lockd: set fl_owner when unlocking files From: Jeff Layton To: chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, "J . Bruce Fields" Date: Mon, 11 Jul 2022 14:36:50 -0400 In-Reply-To: <20220711183014.15161-2-jlayton@kernel.org> References: <20220711183014.15161-1-jlayton@kernel.org> <20220711183014.15161-2-jlayton@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Mon, 2022-07-11 at 14:30 -0400, Jeff Layton wrote: > Unlocking a POSIX inode with vfs_lock_file only works if the owner > matches. Ensure we set it in the request. >=20 Oof, that description makes no sense. How about: "Unlocking a POSIX lock on an inode with vfs_lock_file..." > Cc: J. Bruce Fields > Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") > Signed-off-by: Jeff Layton > --- > fs/lockd/svcsubs.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c > index 0a22a2faf552..b2f277727469 100644 > --- a/fs/lockd/svcsubs.c > +++ b/fs/lockd/svcsubs.c > @@ -176,7 +176,7 @@ nlm_delete_file(struct nlm_file *file) > } > } > =20 > -static int nlm_unlock_files(struct nlm_file *file) > +static int nlm_unlock_files(struct nlm_file *file, fl_owner_t owner) > { > struct file_lock lock; > =20 > @@ -184,6 +184,7 @@ static int nlm_unlock_files(struct nlm_file *file) > lock.fl_type =3D F_UNLCK; > lock.fl_start =3D 0; > lock.fl_end =3D OFFSET_MAX; > + lock.fl_owner =3D owner; > if (file->f_file[O_RDONLY] && > vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL)) > goto out_err; > @@ -225,7 +226,7 @@ nlm_traverse_locks(struct nlm_host *host, struct nlm_= file *file, > if (match(lockhost, host)) { > =20 > spin_unlock(&flctx->flc_lock); > - if (nlm_unlock_files(file)) > + if (nlm_unlock_files(file, fl->fl_owner)) > return 1; > goto again; > } --=20 Jeff Layton