Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1050567pxb; Sun, 7 Mar 2021 04:39:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwa4WnbHd54T56jcBCsQ4Lg13JxvY99HD09rTNF4eWWdJ7zc2P/U3DTcCPiRpMxoLJrFkxv X-Received: by 2002:aa7:c9d1:: with SMTP id i17mr17115277edt.46.1615120773475; Sun, 07 Mar 2021 04:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615120773; cv=none; d=google.com; s=arc-20160816; b=mlLMrL7TjpoZ3KanFKFo6ooWowwz8yv6spBy7dcGfhHGx71wewZ+90jjEoZpeqKRso O96PyRNYLr1K7F2io4y7s8wwcWT8W/QqiHgES1IIoODrKdGGoBH0VHqF4mQhDCzgNB8r 17zDZKvLeH6KenprkV/LGUcZPKQePE4EZwJsuCvNbPi9h8WPcsReMMeQYSO51NaSxqVN scW+Z095qtxTUkEsaSG207wVXI+k24PFV5exq5M6yR2YG6oiPownkcxcm+R5WEHkoU7E C7kc2lA7yqlRWpYSYKoY1E4+OBAwt0ATlRLTmZoUbLQp2Zf5fdpefocX1Am/KR5wJfHl EiEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VuSNp8ohCEDTVNqOLRIMNo7zaXhyGLF+pvmM+1TvWQg=; b=qRlXXaKhIXJy6hrXPfnqW7BonJCt5Ndr5kIhFMoTP11WFi4RVA7OL7afqpIi1uOdxB uRh2aGF9tdMl5ntbLEKt9zPrhIWFXK/P6QowsgRQhkSqV4PVSNTWlxgfik0nJ8AYTsHy /2R3NI5SsD2mcphtdDinkV7ZZS6CXJbKjckKUlY1xUANxZm7oGpH7R28zJAEy5cd30k1 1Um0KLNxZvNeYlOMKwLNqqyoUFhj+rxQzAWDyTS/h7BGcMs6jVBrvxYJYlCO0hM3aLDe aeSSppuTum9WqMiFxtbI0CFV/xR07/my6bigdint7OLQPphtip9YO18T68igDATsXpou 2fhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g2GpQyn+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si2533146edy.116.2021.03.07.04.38.18; Sun, 07 Mar 2021 04:39:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g2GpQyn+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231526AbhCGKvE (ORCPT + 99 others); Sun, 7 Mar 2021 05:51:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhCGKua (ORCPT ); Sun, 7 Mar 2021 05:50:30 -0500 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59123C06174A; Sun, 7 Mar 2021 02:50:30 -0800 (PST) Received: by mail-yb1-xb33.google.com with SMTP id c131so7016829ybf.7; Sun, 07 Mar 2021 02:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VuSNp8ohCEDTVNqOLRIMNo7zaXhyGLF+pvmM+1TvWQg=; b=g2GpQyn+lSSG941waxTRsJNyYVrlP+w4Z1byHE6B11GbHqF1ij4Bg+3I5KpB4EDgnJ B1tgnEyQS9XTafRwNoYit2OUoYikss0E8qxrfxoHpQn1gFLoPve9mA1vQG7k4sIXfIrg P61/iE60aSupZHVQvUlJI9Ur+a0QKCnV15iGyjV1Jha5drAiZCIpkdli9fNG26Fb94Xa QXHsELSumBNe2xMCPUo+8P8WiR3q3pLFbzeEGiFA81GG3iYBYHQ+1ba7iqWZxCvIT1FL Q3590rHIW6CDAtURAlGI2zF9VoDzbk0mSxIwoR5Yj+/qZkvE1CdBeKlLz31zLzom+1Fq vE1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VuSNp8ohCEDTVNqOLRIMNo7zaXhyGLF+pvmM+1TvWQg=; b=BHrciYPuwnHULU7Z7DjMNcILrzoSVRQ/BCbhXuuCdb3ECZheicpm2Tx426JEGHGLCh hZnuEz6HwJ7Mfcm9r+5uTQ87/kbk6OTlti9+pkVOsUx01LmXXfCXT6kNRyUWyuPJbF8A ymITV2IjNc4BWxyxAsJnmdb6xE5ApIo7gQf2/lphGfvwRzYhVwBzKfM/9hKhS/j1T9TF SP41vo0/G3Vrb3z/x6gCuNACL9FvqZibWXJcFMPMnKqUcfDYVMrAaDFFvGMgSb1Z1C8w zV+2zUtqW2TVOlS6nh/m2li8/QIpV+PAyj/DEi1jYX38NVkWungaU/BVUd9XYk9GZKTu /hJw== X-Gm-Message-State: AOAM530BwKwXKw+4545SL+QevnthenTaRSeyjuTk082HaQ+FqPw8Q/dT lofBOUAKDkL0Z82/ft2o6ZxkpMHDS7fOmnh7iMI= X-Received: by 2002:a25:ab82:: with SMTP id v2mr26092512ybi.97.1615114229379; Sun, 07 Mar 2021 02:50:29 -0800 (PST) MIME-Version: 1.0 References: <20210305094107.13743-1-vincent.whitchurch@axis.com> In-Reply-To: <20210305094107.13743-1-vincent.whitchurch@axis.com> From: Shyam Prasad N Date: Sun, 7 Mar 2021 16:20:18 +0530 Message-ID: Subject: Re: [PATCH] CIFS: Prevent error log on spurious oplock break To: Vincent Whitchurch Cc: Pavel Shilovsky , Steve French , kernel@axis.com, CIFS , samba-technical , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincent, The reason for rejecting the request maybe a number of things like: corrupted request, stale request (for some old session), or for a wrong handle. I don't think we should treat any of these cases as a success. Also, from the MS-SMB2 documentation: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/4f35576a-6f3b-40f0-a832-1c30b0afccb3 "The client MUST locate the file in the GlobalFileTable using the LeaseKey in the Lease Break Notification. If a file is not found, no further processing is required." So I don't think we should be changing the logic here. If SMB v1 had a different behaviour, we should check if that is as per the protocol documentation. If not, change it. Regards, Shyam On Fri, Mar 5, 2021 at 3:12 PM Vincent Whitchurch wrote: > > The SMB1 version of ->is_oplock_break() returns true even if the FileId > is not found, as long as the oplock break notification message structure > itself appears to be valid. A true return value makes > cifs_demultiplex_thread() to not print an error message for such > packets. > > However, the SMB2 version returns false in such cases, leading to an > error "No task to wake, unknown frame received!" followed by a hexdump > of the packet header being printed by cifs_demultiplex_thread(). > > Note that before commit fa9c2362497fbd64788063288d ("CIFS: Fix SMB2 > oplock break processing"), SMB2 also returned true for the case where a > connection was found but the FileId was not, but it's not clear to me if > that commit really intended to change the behaviour of the error prints. > > Change the behaviour of SMB2 to be the same as SMB1 and avoid the error > messages for these packets which we ignore as per the spec. > > Signed-off-by: Vincent Whitchurch > --- > fs/cifs/smb2misc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c > index 60d4bd1eae2b..3ea3bda64083 100644 > --- a/fs/cifs/smb2misc.c > +++ b/fs/cifs/smb2misc.c > @@ -679,7 +679,7 @@ smb2_is_valid_lease_break(char *buffer) > } > spin_unlock(&cifs_tcp_ses_lock); > cifs_dbg(FYI, "Can not process lease break - no lease matched\n"); > - return false; > + return true; > } > > bool > @@ -755,7 +755,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) > } > spin_unlock(&cifs_tcp_ses_lock); > cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n"); > - return false; > + return true; > } > > void > -- > 2.28.0 > -- Regards, Shyam