Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2278613ybi; Sun, 9 Jun 2019 07:56:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVwgyqbp+BkRWuEqJd4fONmKLQKtZ7KgIqH1/zpbR7Q6S6wSo7MYRpjJ2LkhIXGNJbjAA9 X-Received: by 2002:a62:82ce:: with SMTP id w197mr5906930pfd.192.1560092187643; Sun, 09 Jun 2019 07:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560092187; cv=none; d=google.com; s=arc-20160816; b=g0NBftdoX/jGBmR6x/sOfXCd2XQCyzJDVqHBBT1WqHl0/ieON+6f6i514PHUc6i+wm w0ble0Dgtz4IpR+lUWgNK3ELw++2MbaJmzo+s1q3mlQCGJaSxKo2Ab7nnKthfKxbabzx bMWzbYkpP4ed+Wh7DU7ZijADcIqhQVNQN/kNHZ6lZvzjp9qXvnF3M1gIUdAYLlTa91+y 6mBzvko9r9MqWf557lX0szLcIMOxhEAaX/Yy2YWaYwR70baSeDg/UCzu5GRlVfDKSJKJ adwME2ACpZIqJveYFzQk9WGiG8elIwxPXKszI31ugkyXmJ6Gb5qgl0jHtSebObYcGut2 +xMw== 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=8NPqAV0ieNyzOZGqpqAKuzdt9sBdqoIrZdZwXwFyY0o=; b=r93uQh+fMqrKwGqkV4Wi3nt7TX0AJIrT9/fG5UlSZxDhd2qodEnCZBmPjHj22t1Ckz VMnuiDaWCvDf9k/xxbwF+XC5p8VcB9KDjZ9H8R2cHUs/fUbdaSntqR0Mf9jzTYiEHmZl Rp5Zg1BL8pJubKqd49gXt/hptEQzPMvgJDqHyzm+DJYnWY6lZMOKhSSxd7Prb5w1ZUe7 zSokUyaX5p83J/pyumYQEliab1Ppm5b/9WbBLzFF7+27P7w/YvXExUw+HvrCqXHvyHMs KnO3bBtk2CAHy/U9FlthZCaAYWBEmM1X7P0EGzU3ru1O+zeHVJAoyWRMEf/HqS+vAypg EPaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=au3C9M3q; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=QD1Gg5GP; 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 m3si7025249pjk.86.2019.06.09.07.56.10; Sun, 09 Jun 2019 07:56:27 -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=au3C9M3q; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=QD1Gg5GP; 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 S1729044AbfFIOyN (ORCPT + 99 others); Sun, 9 Jun 2019 10:54:13 -0400 Received: from mail177-30.suw61.mandrillapp.com ([198.2.177.30]:36805 "EHLO mail177-30.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728534AbfFIOyN (ORCPT ); Sun, 9 Jun 2019 10:54:13 -0400 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Jun 2019 10: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=8NPqAV0ieNyzOZGqpqAKuzdt9sBdqoIrZdZwXwFyY0o=; b=au3C9M3q2/WKKblEjm8os8w0arpH8K34cnrjwB9QeSHwY8SwYrrKrrOXkGa7aNeiE2ox1frKkp8n 4IADGsyFOYEQeBBVoID9DkQViFoHeLd2EDYIxw+NOZfEDAO6oVrmD3maASx9jYf6zHdqXexP8bk2 cFBHvjZXbDkdDDTQz1E= Received: from pmta06.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail177-30.suw61.mandrillapp.com id hvkep822rtkn for ; Sun, 9 Jun 2019 14:39:09 +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=1560091149; h=From : Subject : To : Cc : Message-Id : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=8NPqAV0ieNyzOZGqpqAKuzdt9sBdqoIrZdZwXwFyY0o=; b=QD1Gg5GPmbzB+TEuJmukP5MJ/9Y4HXi5De0zFbnDbI/r5wrFbpJMO5cjkW5f2Zt37Vfvyj A5mqoVMgpDKfr1Fyj13O9lFUKjw7HJrOz3iffSChv22j05L2VsiN6oCW5G9jAFpi7iCyAuOU KxM+MTFeUaRyJt9F47rJKO4G4wTq8= From: Kirill Smelkov Subject: [PATCH 3.18 0/2] Fix FUSE read/write deadlock on stream-like files Received: from [87.98.221.171] by mandrillapp.com id 49e2eef631cb48dfb884b9e188d01f9e; Sun, 09 Jun 2019 14:39:09 +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: <20190609133501.7873-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.49e2eef631cb48dfb884b9e188d01f9e X-Mandrill-User: md_31050260 Date: Sun, 09 Jun 2019 14:39:09 +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-3.18 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 3.18 (as well as into other stable trees - I'm sending 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 | 2 +- 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(+), 4 deletions(-) create mode 100644 scripts/coccinelle/api/stream_open.cocci -- 2.20.1