Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3598564imw; Mon, 11 Jul 2022 11:43:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u9jn1bdMudhgl09nRzV2pgHSNPuNdNx6IijOV+/UtnSxCCIU7wH+rzxgIE5HYTAAHmGh5x X-Received: by 2002:a17:907:2c6b:b0:72b:2eb9:6673 with SMTP id ib11-20020a1709072c6b00b0072b2eb96673mr18189791ejc.71.1657565036586; Mon, 11 Jul 2022 11:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657565036; cv=none; d=google.com; s=arc-20160816; b=Ak/ey1GWlDm1+N4Snhx/YJ9olZi85p/TuEZ84wsvS9rU8T3ANjGi5CSvtI/8QEFzN5 D2lwxod4nHsU3KBTz5/g9RIPAVO8JVj97nO3qKkv0+mRtXTG8pIrbDFFOe1iYEvrbyM0 92ARzzpzmRENjjIogdr/pHA7OtJfCtjDVgtkXa+Uuw3m7EwUCH1YZ2V7ZdZP9TjzKj0o Vkzha/vUN3ZPg1mtwSDsa/bFlWdbOeovCPa8zPeHZSQCq7lpzTrEMufM64ACl46QGWs2 W6kMDj9oGE3blh27ZocKNDzPEImcvc70n+n1GCJGVga6WhtgJeKlwpuuWs2JhBHZ+yz/ GhBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vtiDhyd1ylCIz3dnSjnptLjW8u0LhxR5ywcGOrrX04Q=; b=ozBHwG0swtvx5WLR6FTA4z38T5nsrlc/5wQat1ArKdA/sLiZV4kqbZlVINng2Cl3Wr FKAcLm7vlDqxvgmzdC2xjsebAawIxaxVcjFg3ForeY4oL1gLrFaxvw7CiQW/WhfsGXfD Vd7CLyrj2wMubrWGRhDcY9sW8MCx6l5CYiuQm73cz3TdM4Uwz1Bmv+OydYxsxUYG5dYS PFrxmCqDy4Io6O/PukkJltML1eF8hAac1hVjRh29n0tT0EKbWH2Fu78UV7Arfu7eHS60 KVeBgWRrS4OzHY7YCJqRWXH+1xsWyy5zGF0z5JesNiG2A9yrETl6XeGu0AY7hAjy+FVL 8Q3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WNpGcP8u; 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 j5-20020aa7c0c5000000b0043586d19cf9si9623290edp.465.2022.07.11.11.43.30; Mon, 11 Jul 2022 11:43:56 -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=WNpGcP8u; 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 S229628AbiGKSau (ORCPT + 99 others); Mon, 11 Jul 2022 14:30:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiGKSat (ORCPT ); Mon, 11 Jul 2022 14:30:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A5C47AC22 for ; Mon, 11 Jul 2022 11:30:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id D545EB81126 for ; Mon, 11 Jul 2022 18:30:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11C6BC341CA; Mon, 11 Jul 2022 18:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657564217; bh=GA/G/YGzJV89w2p/2Z+fcyEnpNh175KiLw4OuIexOv8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNpGcP8uWxcn1r955Pc146pwMaEov1dygCU6VX5yMzYIOwkd2WOzkDdbaStUftUJD Eyy0bZ2ZLvu3Hmqrlij02j7tXmM4JIUkIg4vu869nx+dIi9zL4DZRVZMvHfAfMZ43Z kswTm+CGbNAiaIuiaAYn2/nzTKWp8Xc8cbh1HFlzgWdN+fBTNAirVkJz/BdTU9Trz8 sDduU4hGMkVtzIoMuC7dCvEzQZyYVKAyRA/YofAtT+QYVDihFw6G6CCoqsYwgqiMQo VU73Fl758+8ybbaGzTOs4jEc2LLBDnQ6IAt0taM//0SdqxqaVHQ4eyhibR0VZZVXqH oTD8cUfY29YoA== From: Jeff Layton To: chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, "J . Bruce Fields" Subject: [PATCH 1/2] lockd: set fl_owner when unlocking files Date: Mon, 11 Jul 2022 14:30:13 -0400 Message-Id: <20220711183014.15161-2-jlayton@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711183014.15161-1-jlayton@kernel.org> References: <20220711183014.15161-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Unlocking a POSIX inode with vfs_lock_file only works if the owner matches. Ensure we set it in the request. 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(-) 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) } } -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; @@ -184,6 +184,7 @@ static int nlm_unlock_files(struct nlm_file *file) lock.fl_type = F_UNLCK; lock.fl_start = 0; lock.fl_end = OFFSET_MAX; + lock.fl_owner = 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)) { spin_unlock(&flctx->flc_lock); - if (nlm_unlock_files(file)) + if (nlm_unlock_files(file, fl->fl_owner)) return 1; goto again; } -- 2.36.1