Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2187836ybi; Sun, 9 Jun 2019 05:57:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkxiHyYq2WuLKBAO4i/tN+tC2O6GepOWM4LDu99XeFojoqhv+b9Q7scnFLPVmGZ7Uuv7Ed X-Received: by 2002:a63:68b:: with SMTP id 133mr9966756pgg.385.1560085026644; Sun, 09 Jun 2019 05:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560085026; cv=none; d=google.com; s=arc-20160816; b=I5eA2OOZxsu8qH/1/vdYVS5dTSW13hnH/Sn0Ankh15SQbz1VcMT9I62pLGUi4v+X6T 7UYOv8CaNHTkVbR/n+zX+yLrhr3Jt5sEbLzkmFBfzUtxi+Jn+Y7egJ6loTkQWyEXIFAd 08+AS41Ot+C5iqJssn0fuWDewDQSPk/s2ugdduZqgLXYYQiRGN70x8Gl5w5QclxUztFv Ks2eUaFgMa62Bb0FYdu5ct3+XA8ynksVZU+Mo6sFYELBN9nUH2sho4jJq5XOSqq1WRhj qGy6ASf9+k5ZENbihT4B6A9UbgKP2uh7Hk++8IEYghV02/B4JZSndlLp9p2UvUMiv7qi NtiA== 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 :date:message-id:cc:to:subject:from:dkim-signature:dkim-signature; bh=6M5kKn25cx+JybbTUPMUlfxmJC9HjuWYsaCX5CQEPok=; b=wfAGok9VsmNMMNLeNnrUouKsYHPTnVLQWztKB2M9tNVbpnGdP4qurrIjIyE5MgEB+N 9X1PVB/dvyRnEPtvREorkmUgr4e0daBRP1owuaMJfCaL6hKD2nd9SKEpsn8uw3Oc9gg1 kEh+mJYNCGVQx4klGGwo80GkgP2k4dLMlGMTy1yiuKy+OK8RTl/8md4cEA7YBhcZVAOs k0Cl9MX5S6P8aUNEcKh4gN6zpFsKYrBniSCVx7Bqk5YzLGB9ESuTFtotVPFri1sPAYCf JEynIB4gtxHoFnzruB8E1hc9Os9D0BeWG8wGCn9PEmMw7RTmQoNGhTKahs9j/wgNLL7l 2xXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=gktj5n7h; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b="SWOcvk/I"; 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 r4si7091358pgv.195.2019.06.09.05.56.50; Sun, 09 Jun 2019 05:57:06 -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; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=gktj5n7h; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b="SWOcvk/I"; 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 S1728564AbfFIMyN (ORCPT + 99 others); Sun, 9 Jun 2019 08:54:13 -0400 Received: from mail180-16.suw31.mandrillapp.com ([198.2.180.16]:54246 "EHLO mail180-16.suw31.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbfFIMyM (ORCPT ); Sun, 9 Jun 2019 08:54:12 -0400 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Jun 2019 08:54:12 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=6M5kKn25cx+JybbTUPMUlfxmJC9HjuWYsaCX5CQEPok=; b=gktj5n7hrQ92BJq10Taw48AJIToY1dtITFJXVfVreGhkP11PUy1UbbgqfylNpbqt6Xt4pJh0p24/ 2zNsKI8pUydtNmo9DDkQORsC4raltd9F61TJw1UeiFZjqzSoXxD7Sv6qsZF792DBp1Wcp9u2W5Jb Etuvz64uKzN9hwteqKE= Received: from pmta03.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail180-16.suw31.mandrillapp.com id hvk0n822sc0l for ; Sun, 9 Jun 2019 12:39:08 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1560083947; h=From : Subject : To : Cc : Message-Id : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=6M5kKn25cx+JybbTUPMUlfxmJC9HjuWYsaCX5CQEPok=; b=SWOcvk/ICuPUBA4DQ0YdzuqZFNcovc+net1r6qmTr2UZl+SyC0YmEjLJ4/5u4YJ21TzvpL htrQiEUyJy6ct1GjGWNob205ebNpJ0+T9HBL8hsrUakay4dZaaXuRcDYV45tit14xqhCLola RdtbfOtCVfKbpq81PbxoZytPNuGk8= From: Kirill Smelkov Subject: [PATCH 4.14 0/2] Fix FUSE read/write deadlock on stream-like files Received: from [87.98.221.171] by mandrillapp.com id 33d523675c2f43c89af22c199ea3c3f9; Sun, 09 Jun 2019 12:39:07 +0000 X-Mailer: git-send-email 2.20.1 To: Cc: Sasha Levin , Greg Kroah-Hartman , Ben Hutchings , Linus Torvalds , Miklos Szeredi , , , Kirill Smelkov Message-Id: <20190609123831.11489-1-kirr@nexedi.com> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=31050260.33d523675c2f43c89af22c199ea3c3f9 X-Mandrill-User: md_31050260 Date: Sun, 09 Jun 2019 12:39:07 +0000 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 Hello stable team, Please consider applying the following 2 patches to Linux-4.14 stable tree. The patches fix regression introduced in 3.14 where both read and write started to run under lock taken, which resulted in FUSE (and many other drivers) deadlocks for cases where stream-like files are used with read and write being run simultaneously. Please see complete problem description in upstream commit 10dce8af3422 ("fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock"). The actual FUSE fix (upstream commit bbd84f33652f "fuse: Add FOPEN_STREAM to use stream_open()") was merged into 5.2 with `Cc: stable@vger.kernel.org # v3.14+` mark and is already included into 5.1, 5.0 and 4.19 stable trees. However for some reason it is not (yet ?) included into 4.14, 4.9, 4.4, 3.18 and 3.16 trees. The patches fix a real problem into which my FUSE filesystem ran, and which also likely affects OSSPD (full details are in the patches description). Please consider including the fixes into 4.14 (as well as into earlier stable trees - I will send corresponding series separately - - one per tree). Thanks beforehand, Kirill P.S. the patches have been already a bit discussed in stable context some time ago: https://lore.kernel.org/linux-fsdevel/CAHk-=wgh234SyBG810=vB360PCzVkAhQRqGg8aFdATZd+daCFw@mail.gmail.com/ https://lore.kernel.org/linux-fsdevel/20190424183012.GB3798@deco.navytux.spb.ru/ https://lore.kernel.org/linux-fsdevel/20190424191652.GE3798@deco.navytux.spb.ru/ ... Kirill Smelkov (2): fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock fuse: Add FOPEN_STREAM to use stream_open() drivers/xen/xenbus/xenbus_dev_frontend.c | 4 +- fs/fuse/file.c | 4 +- fs/open.c | 18 ++ fs/read_write.c | 5 +- include/linux/fs.h | 4 + include/uapi/linux/fuse.h | 2 + scripts/coccinelle/api/stream_open.cocci | 363 +++++++++++++++++++++++ 7 files changed, 394 insertions(+), 6 deletions(-) create mode 100644 scripts/coccinelle/api/stream_open.cocci -- 2.20.1