Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1627253imu; Tue, 6 Nov 2018 01:31:44 -0800 (PST) X-Google-Smtp-Source: AJdET5ckk5He+COjvUCKfWvc3YqJbD+f2Z+Ful1n7iIL031mxVxBtHkuSR+ug6tCprUIQkL/WCz8 X-Received: by 2002:a62:de84:: with SMTP id h126-v6mr25310167pfg.129.1541496704194; Tue, 06 Nov 2018 01:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541496704; cv=none; d=google.com; s=arc-20160816; b=NVWPiFqcHBBYh2/xF55DtoIS8Zb93i+8LJgow6MHYxJJpvCvmXQ7dcqrneevlQ0q2h DhUu1FoGWRwVC8TiZUaBR1p+8GGpYrX18SX02aiJMQ9Uuc2jKpNx5e/M0UtQJK9DhNm5 72YyNj8HmQevnGPS8x0kTSLLb/scE58hWMyODVfg+QiKgI99GmGjRfaURU75YLsGIgOY J4u7khjN9f5Ju9vxm8skFJixktXnlBcpq8Y1ZdyLmbI3PealPaOlH7mBCaevmIMlR57i 0uX0YMoMx88eIl77mjBhKO4tWlf9DLY95a4157mXGVm+IbVBCiNIWr2Xpz4aaZl18kpo krOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=WHqEM0mytKsZPKItmsyxN406a62c03AVk7R93Y7jmXI=; b=l3I6zZ6iirvRcNOBKVOtH2y3SpduSuqtaFZ7Dfc6+b2AYT5wyHBis/6iCBmIL1PhaW 8wEXf6QCWVNx7S2S5W4V6uLh+KidM4URfO5GN85IHSVqS5stc6cPXcTmAhfk3twWS4Fn favDqUWx1JDBRMEXvo0L6OQE+IaPXaWhbLfHEZRUw7nRacnXAsDvID9wutZ3sGQVdwsP giGHBvqeMpbeCq7gb7egfO4t09gXCFb1rmTk1dkSllQdxC/5/KpzuMs0ASi+z9ie35jk 4KTYuWLRTit7d6uFg/xO0hIpxHrWcIxEahThb4f4WTL0gKIzsbNTZajr7yJuDMMh2sd/ sdCw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si32930669pls.155.2018.11.06.01.31.28; Tue, 06 Nov 2018 01:31:44 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730366AbeKFSzM (ORCPT + 99 others); Tue, 6 Nov 2018 13:55:12 -0500 Received: from relay.sw.ru ([185.231.240.75]:59168 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729430AbeKFSzL (ORCPT ); Tue, 6 Nov 2018 13:55:11 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gJxhC-0002w3-9j; Tue, 06 Nov 2018 12:30:50 +0300 Subject: [PATCH 4/6] fuse: Check for FR_SENT bit in fuse_dev_do_write() From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 06 Nov 2018 12:30:49 +0300 Message-ID: <154149664975.17764.16537105755726576371.stgit@localhost.localdomain> In-Reply-To: <154149586524.17764.5252013294539109287.stgit@localhost.localdomain> References: <154149586524.17764.5252013294539109287.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's not possible to have answer to a request, before the request is actually sent. Add sanity check for that. Signed-off-by: Kirill Tkhai --- fs/fuse/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 739968ee8b0c..c603f1ebf0fd 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1947,7 +1947,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, goto err_unlock_pq; req = request_find(fpq, oh.unique & ~FUSE_INT_REQ_BIT); - if (!req) + if (!req || !test_bit(FR_SENT, &req->flags)) goto err_unlock_pq; /* Is it an interrupt reply ID? */