From patchwork Fri Apr 26 00:32:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronnie Sahlberg X-Patchwork-Id: 10917871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CADF614C0 for ; Fri, 26 Apr 2019 00:33:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B918A28D26 for ; Fri, 26 Apr 2019 00:33:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD6D428D2A; Fri, 26 Apr 2019 00:33:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5769828D26 for ; Fri, 26 Apr 2019 00:33:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729417AbfDZAdk (ORCPT ); Thu, 25 Apr 2019 20:33:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbfDZAdj (ORCPT ); Thu, 25 Apr 2019 20:33:39 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D545D1219D5; Fri, 26 Apr 2019 00:33:39 +0000 (UTC) Received: from test1135.test.redhat.com (vpn2-54-54.bne.redhat.com [10.64.54.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F6561001E6C; Fri, 26 Apr 2019 00:33:39 +0000 (UTC) From: Ronnie Sahlberg To: linux-cifs Cc: Steve French , Pavel Shilovsky Subject: [PATCH 0/1] cifs: fix credits leak for SMB1 oplock breaks Date: Fri, 26 Apr 2019 10:32:22 +1000 Message-Id: <20190426003223.4763-1-lsahlber@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 26 Apr 2019 00:33:39 +0000 (UTC) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pavel, List Here is an update after the email discussions. This is minimal patch that adds a new flag to specifically indicate that there will not be a response to this PDU and thus we can immediately add the credits back after sending in compound_send_recv() This flag is only set for SMB1 oplock breaks so this will not affect anything else. Additionally, we no longer need to check the CIFS_ASYNC_OP flag in compound_send_recv() so we can remove that conditional. This is the smallest patch which fixes the actual smb1 oplock bug thus we should be able to get it into an rc, and stable. But we need more but that should wait until the next merge window. The next steps we should do is: Remove CIFSSMBNotify() completely and with that also the check for CIFS_ASYNC_OP in SendReceive() When that is done, the only thing that CIFS_ASYNC_OP does is make sure we do not block in wait_for_credits(). Which means we could rename this flag to CIFS_NON_BLOCKING. We should also rename CIFS_NO_RSP to CIFS_NO_RSP_BUF to make it more clear that there will be a response status code but there won't be any or we don't care about any response buffer. Thus the semantics will become: * cifs_call_async() : if you want async handling of responses * CIFS_NO_SRV_RSP: There won't be a response so do not wait for a reply. (only used by SMB1 oplocks) * CIFS_ASYNC_OP/CIFS_NON_BLOCKING: do not block waiting for available credits.