Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2431060imm; Thu, 7 Jun 2018 10:26:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIvp2coeS+Oe4GO6lEGlguBOjg2BLvstQggXfZkUpBmACaTEJ+XUuKxnQ9lEKVeqnYy71T8 X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr2964661plr.132.1528392413023; Thu, 07 Jun 2018 10:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528392412; cv=none; d=google.com; s=arc-20160816; b=nfFMy3ax0G4kKWS3EYpnx9cbikWw3fVxk32SVuz3tdDVTUz68VTMp1+bsYUHhebkuh T7NGIBF9O2rMuOJwpu8fNVU33IyzaY1SNKxh5t05yLjOodxgZhg3sVZ7F1E/+9zdvrOy 58xHRIrJMzN5A+R0xIxmst09r8kFMOpC80+q8Xyj1sKoW0iZ/aX32q3shdNP/riYf7ul 4HGGsPAasahNgyFdrn2zWS4qxNpMxERxDok0rjIa+6jjD1o7DL7ssMhuKpSC6CHvOvvo xBiqVW9xv03Pd3xzYIKyjIUKXkt6BXue1FrUbmLwagVOVnTpqXC9QUPmZgd0Vj5Q9Ytf 6hPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=6iehHTwhsG7FZrRx2yVfJ/b7SBC/Hfp4a5xd2UqGPos=; b=QQmg8jPkfA7ClYyTPpC67tFwlmh/7x+xeMjO4/8NbEc+J31b0bHPN4G6k8hxeQqQN3 FjjJKMVQUrKMSPbpror78fFqteKyGgmnLAk8MXiFt2Wup2Fc2WhFNvvDo796rH1/VeJm TxVufs++IcsVwp5ZJQzx4yMlL6x0idnihhzJyPh8QcXuMXOfRjG5pQsvmJ6QHkTEtjR7 WfdCEXcm1UcD4FpKywaBEm5d5CKUPBZ4rhKTthlc3XbAyo+swilrJmB+zPN6Ug7MC1B2 baA4Zv1LG/x9VDl1ZNsAhyXGsVVhaBRo5OT1sCAayb11aWtYrttavHTpGz39I4eDTCro 0zbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si55112985plf.63.2018.06.07.10.26.31; Thu, 07 Jun 2018 10:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933625AbeFGOct (ORCPT + 99 others); Thu, 7 Jun 2018 10:32:49 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40289 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932911AbeFGOcp (ORCPT ); Thu, 7 Jun 2018 10:32:45 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbd-0005Zp-Im; Thu, 07 Jun 2018 15:09:37 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb7-00032Q-05; Thu, 07 Jun 2018 15:09:05 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kurz" , "Michael S. Tsirkin" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 222/410] 9p/trans_virtio: discard zero-length reply In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kurz commit 26d99834f89e76514076d9cd06f61e56e6a509b8 upstream. When a 9p request is successfully flushed, the server is expected to just mark it as used without sending a 9p reply (ie, without writing data into the buffer). In this case, virtqueue_get_buf() will return len == 0 and we must not report a REQ_STATUS_RCVD status to the client, otherwise the client will erroneously assume the request has not been flushed. Signed-off-by: Greg Kurz Signed-off-by: Michael S. Tsirkin [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- net/9p/trans_virtio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -164,7 +164,8 @@ static void req_done(struct virtqueue *v p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc); p9_debug(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag); req = p9_tag_lookup(chan->client, rc->tag); - p9_client_cb(chan->client, req, REQ_STATUS_RCVD); + if (len) + p9_client_cb(chan->client, req, REQ_STATUS_RCVD); } }