From patchwork Fri Dec 17 15:08:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 416131 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBHF8NEW000693 for ; Fri, 17 Dec 2010 15:08:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755134Ab0LQPIo (ORCPT ); Fri, 17 Dec 2010 10:08:44 -0500 Received: from mail-gw0-f42.google.com ([74.125.83.42]:36141 "EHLO mail-gw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221Ab0LQPIm (ORCPT ); Fri, 17 Dec 2010 10:08:42 -0500 Received: by mail-gw0-f42.google.com with SMTP id 20so493910gwb.1 for ; Fri, 17 Dec 2010 07:08:42 -0800 (PST) Received: by 10.90.82.3 with SMTP id f3mr2281077agb.83.1292598522443; Fri, 17 Dec 2010 07:08:42 -0800 (PST) Received: from salusa.poochiereds.net (cpe-071-070-153-003.nc.res.rr.com [71.70.153.3]) by mx.google.com with ESMTPS id 2sm4330382anw.38.2010.12.17.07.08.41 (version=SSLv3 cipher=RC4-MD5); Fri, 17 Dec 2010 07:08:41 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 18/18] cifs: send an NT_CANCEL request when a process is signalled Date: Fri, 17 Dec 2010 10:08:17 -0500 Message-Id: <1292598497-29796-19-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.3.3 In-Reply-To: <1292598497-29796-1-git-send-email-jlayton@redhat.com> References: <1292598497-29796-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Dec 2010 15:08:46 +0000 (UTC) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 1488b7e..e2e66f3 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -570,20 +570,25 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, #endif mutex_unlock(&ses->server->srv_mutex); - cifs_small_buf_release(in_buf); - if (rc < 0) + if (rc < 0) { + cifs_small_buf_release(in_buf); goto out; + } - if (long_op == CIFS_ASYNC_OP) + if (long_op == CIFS_ASYNC_OP) { + cifs_small_buf_release(in_buf); goto out; + } rc = wait_for_response(ses->server, midQ); if (rc != 0) { + send_nt_cancel(ses->server, in_buf, midQ); spin_lock(&GlobalMid_Lock); if (midQ->midState == MID_REQUEST_SUBMITTED) { midQ->callback = DeleteMidQEntry; spin_unlock(&GlobalMid_Lock); + cifs_small_buf_release(in_buf); atomic_dec(&ses->server->inFlight); wake_up(&ses->server->request_q); return rc; @@ -591,6 +596,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, spin_unlock(&GlobalMid_Lock); } + cifs_small_buf_release(in_buf); + rc = sync_mid_result(midQ, ses->server); if (rc != 0) { atomic_dec(&ses->server->inFlight); @@ -735,6 +742,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, rc = wait_for_response(ses->server, midQ); if (rc != 0) { + send_nt_cancel(ses->server, in_buf, midQ); spin_lock(&GlobalMid_Lock); if (midQ->midState == MID_REQUEST_SUBMITTED) { /* no longer considered to be "in-flight" */ @@ -944,6 +952,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon, rc = wait_for_response(ses->server, midQ); if (rc) { + send_nt_cancel(ses->server, in_buf, midQ); spin_lock(&GlobalMid_Lock); if (midQ->midState == MID_REQUEST_SUBMITTED) { /* no longer considered to be "in-flight" */