From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_MED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F104FC28EBD for ; Sun, 9 Jun 2019 13:56:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4368208E4 for ; Sun, 9 Jun 2019 13:56:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nexedi.com header.i=kirr@nexedi.com header.b="GGMOqlfw"; dkim=pass (1024-bit key) header.d=mandrillapp.com header.i=@mandrillapp.com header.b="GvozA1Nb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728799AbfFIN4p (ORCPT ); Sun, 9 Jun 2019 09:56:45 -0400 Received: from mail177-30.suw61.mandrillapp.com ([198.2.177.30]:27120 "EHLO mail177-30.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbfFIN4o (ORCPT ); Sun, 9 Jun 2019 09:56:44 -0400 X-Greylist: delayed 906 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Jun 2019 09:56:43 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=112cZkYq00mkGEI9ggEVbOXM3lgRmy7KLKo6Z1zIIFQ=; b=GGMOqlfwk4oDA8XieDW1RfpA5Ru6AiOFTVt+0SLlI1SjHMI0fhXJAKjUtoUAoEVXLT+ubxhiPN8M TNpa7hDravZ4UY61pY3JRO91bjAsVDFgjIEG5UXXsa7groIBxm5TTsEcWstEvOav8RPi0Ot/P8ki f16Cx0U6QtTZ/IZQM4U= Received: from pmta06.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail177-30.suw61.mandrillapp.com id hvk81m22rtkn for ; Sun, 9 Jun 2019 13: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=1560087548; h=From : Subject : To : Cc : Message-Id : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=112cZkYq00mkGEI9ggEVbOXM3lgRmy7KLKo6Z1zIIFQ=; b=GvozA1NbQM8fV6RaYFkG/0VjLuN73YmvBLDxPoDjTkZnxNgTQIueCAfTW8QyyDQB8guFW1 ZjrXwXLH/zZ5qE8kfln4l3OnYyds2YOaxrHjYg31oPZ1IKkWTZH7fBEwW6N6SN5XJhyMfIrR 8pxjPRBpBsKlmS7QgQDOu12DOM4I8= From: Kirill Smelkov Subject: [PATCH 4.4 0/2] Fix FUSE read/write deadlock on stream-like files Received: from [87.98.221.171] by mandrillapp.com id 461f093d7cdb4b759727d86a86a7b3df; Sun, 09 Jun 2019 13:39:08 +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: <20190609132443.9420-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.461f093d7cdb4b759727d86a86a7b3df X-Mandrill-User: md_31050260 Date: Sun, 09 Jun 2019 13:39:08 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hello stable team, Please consider applying the following 2 patches to Linux-4.4 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.4 (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