Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp395012rdb; Mon, 22 Jan 2024 07:30:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGO0tYea5J0MFK6GQt3CaZ0dOXbwHmnegYRZNOo3P8YFdpq/pYxdo0oiFafNRDQed+gg4Rc X-Received: by 2002:a17:907:7817:b0:a28:ac22:7575 with SMTP id la23-20020a170907781700b00a28ac227575mr6416360ejc.4.1705937446830; Mon, 22 Jan 2024 07:30:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705937446; cv=pass; d=google.com; s=arc-20160816; b=EVauPdRyL1Kx4wwHlLfVFq95e6QXffm7xvypNTMwZIkIDRVg+T7pBY9j4eKvFhSLy6 n5pTHRqi58RCdsa+C+qf7rRQ4mXH+fbmx7enOChBXEkgsme0Kp32hasPCvD+O9WsZL7h C6BMACa2hCi/TpABkeSt06NHUbn+yuRfo4Q0FkUW6jxUSQBUTnEI3eodKfgX37lu6NV2 kgorGRk+jlcpuX24EEYXPrSDZ1EHyzXSc0mGXIOVGwIPAAd/hBd/ReWjgAf6Kzx/YSzb QtBjOV6CweyqNkZE+JoLEWkOYdU59CSOTQHsMyZH6imxcYjlOYs9lKt0j8fJl25MSUuw ni2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FENXJQgDNH1ZNC0GLrluZ9nPbOYPNu9HukiJuP5c5ZI=; fh=YCpWGDe4dlD/Msuo/KjbMNPS2Hvd2LSPoVlNK8Y+dew=; b=0Cfqxgr499228n7BdfkriuFa8umoDVr/WVJV8/pkbFtkBO4jhF0oPpUBaHfTHoMdX8 VIphTFCAb3HqEj9sJNKQB47ppx2Cya+65g3dZ/9TnGfacsd1ZTrUyJkS2VQLf0bh1YHb tFQU33eN5O8R2eQ07IwWoiXB9S8o0TozW90By+1hdNBylly121Z4QwwpFcx4AfYB9a7R KZNqf+7IEp62DDwrYkIlMIlBo6kViR3TfoG8FZB9CsFpSK8Gb4ooyOHaZEQv7QF+3IN5 +eS7yoi2CCQ0epeKGBBF8OksGj8T12lyFCgBhBS1ZyMhtyudjEYLLYQI36eN6YUZUwsP SWSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iD6QXqRD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p3-20020a056402500300b005564f353c64si11432290eda.687.2024.01.22.07.30.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:30:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iD6QXqRD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 96EF11F2126E for ; Mon, 22 Jan 2024 15:30:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DC775FEFD; Mon, 22 Jan 2024 15:02:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iD6QXqRD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33EC95FEE4; Mon, 22 Jan 2024 15:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935746; cv=none; b=AdON/dukGg6xOux8oqXmijmnXPKv56U4FBdp6j7v3kxE9uQlqAT7jXE1ZGjEtbfqyw+Ht1pqWLaL4OSHjtoassKkq3R69AJkTwtMPYTnnYLsv0Yt/dLINDRrtrdgej1mpuUzHy9K916CSKuXffejK6KWwtC3tx5tBaFQxmX17L0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935746; c=relaxed/simple; bh=6MUIiwQtfzOMU4krgJ1pAmawqGlakVp+3hazCD2oV6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HPvaxcFdwYJb0sFTmfnlnrFhSDqbHu5VQwkWBl6b1hdbwuo2dKjIBTMORRtcXm/mEKY4sHgelbCIGcxKJqSPi27Hut7KwnvAYN/gFrkmF0XWkHJFqZcGcvYfWDhkn0YHMiEm6I2cx2pVldgist+YFpdCXCuuNVK8Yz0aaMd9oHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iD6QXqRD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 135A7C43141; Mon, 22 Jan 2024 15:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935746; bh=6MUIiwQtfzOMU4krgJ1pAmawqGlakVp+3hazCD2oV6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iD6QXqRDhLgF+cyY1MZIl683Cxu4o3MjxglaT3xtbcYn2iko/qalBsi0qWDNKQD6a F4d6FP1fHrKLYenedX2B6ZKzANpCGSFItej89D5Jen06BHPt2BeYKGrPTAyLo6iqTB Oo+BuMffRjUd2bcN3ub6SUu5dgyfrcEBdHS656ukIVcx6mK2vfCODpH1p0wdeLLwKS ky2HNh72MdxMNYBeyGnKr65ldEoDkH70AwE9JRwlUUqgrxHCNgmUu1L57yr+AsWKlG QEEUDMq5+2zgkDm8YqJnH6DupCqCgHTaod0P5zGxuIZ/YUPdEx+bPzCZXKFR4GXw8v rFWfrjMDMBoSg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Namjae Jeon , Steve French , Sasha Levin , sfrench@samba.org, linux-cifs@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 88/88] ksmbd: send lease break notification on FILE_RENAME_INFORMATION Date: Mon, 22 Jan 2024 09:52:01 -0500 Message-ID: <20240122145608.990137-88-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Namjae Jeon [ Upstream commit 3fc74c65b367476874da5fe6f633398674b78e5a ] Send lease break notification on FILE_RENAME_INFORMATION request. This patch fix smb2.lease.v2_epoch2 test failure. Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/oplock.c | 9 +++++++-- fs/smb/server/smb2pdu.c | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index 9a19d8b06c8c..6bf2b675add9 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -546,6 +546,7 @@ static struct oplock_info *same_client_has_lease(struct ksmbd_inode *ci, atomic_read(&ci->sop_count)) == 1) { if (lease->state != SMB2_LEASE_NONE_LE && lease->state == (lctx->req_state & lease->state)) { + lease->epoch++; lease->state |= lctx->req_state; if (lctx->req_state & SMB2_LEASE_WRITE_CACHING_LE) @@ -556,13 +557,17 @@ static struct oplock_info *same_client_has_lease(struct ksmbd_inode *ci, atomic_read(&ci->sop_count)) > 1) { if (lctx->req_state == (SMB2_LEASE_READ_CACHING_LE | - SMB2_LEASE_HANDLE_CACHING_LE)) + SMB2_LEASE_HANDLE_CACHING_LE)) { + lease->epoch++; lease->state = lctx->req_state; + } } if (lctx->req_state && lease->state == - SMB2_LEASE_NONE_LE) + SMB2_LEASE_NONE_LE) { + lease->epoch++; lease_none_upgrade(opinfo, lctx->req_state); + } } read_lock(&ci->m_lock); } diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index a2f729675183..5a31d47875da 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -5569,6 +5569,7 @@ static int smb2_rename(struct ksmbd_work *work, if (!file_info->ReplaceIfExists) flags = RENAME_NOREPLACE; + smb_break_all_levII_oplock(work, fp, 0); rc = ksmbd_vfs_rename(work, &fp->filp->f_path, new_name, flags); out: kfree(new_name); -- 2.43.0