Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2337118ybi; Sun, 9 Jun 2019 09:14:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDsouhASZH2xLPkWOiJCKlTzl0uSuLMbVCxWLYAEYxiSUre/WlF+cVyInkjwWY8XEXoB8+ X-Received: by 2002:aa7:9087:: with SMTP id i7mr12562832pfa.40.1560096898901; Sun, 09 Jun 2019 09:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560096898; cv=none; d=google.com; s=arc-20160816; b=EkYO1bZ7nnI+THk+alWR95jtIlLl8BL8XwSvFdA9PBzeuesG602f2/KbDmuovAZZQj BZTTCpwcpzjAeakdDEglDUjJ48rotWFVrYLM/GwKfvzFNy0J6n8ccHMzZpfC8I8x11Wh y1htiMDOnP16d429QW722Jsu1IOytv/HFoJEWEKXfuZbPUUvV6JccXZLzLxFxY5TcMt5 ITQCNmRcdwr0I9iWs8Sr/tJhgXL/W3JW5GKGiPn2ZJMNDPY3Q3+OIKiM1ZFORjxCAFk0 J7ttZU3dbhvNIkhuAsoBSpoWV/f7GdU8FI5q+mmls+PAiU3yo9Rd06tcoE0neK8T5ShF tKfA== 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=UBm1Ha65NyTbaemRU67DRfuweZgj6OScpzVWtCG9DoQ=; b=nv3PxsfmmXAZoqzdV1NDOb4620tLbjNcB8qoE+LUGjGcWbsG9qX8ijrSohS7cLgy0s z1OCkm2kKsGC8E1U4L4nRJ6xvwEcg3xCPYUfZ5A1XT0PM8UOpxEibiM/OEPHMCUX6Ajc XoKdmU76EVfMsj3UXHgm9j4HDmKC41bROVOLb8s+BFoxizMi61msVDk7ypGd3+fD9vm3 jzcEe16lzsF6FUwFDS+5Lu3fiuRVmx0mtMkeY5aXKtcY26VmA+991tkuLdqf9uywl89J W6b+fbgVGQo1m2WZyUqt+0js9kOytDkQ34IXp9NSD2m+QiyjEvi1wlRp6pALJkwFLsVw 6sWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=DBR5mcH4; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=C836yH92; 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 c3si7772181pfr.27.2019.06.09.09.14.31; Sun, 09 Jun 2019 09:14:58 -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=DBR5mcH4; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=C836yH92; 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 S1728970AbfFIQLD (ORCPT + 99 others); Sun, 9 Jun 2019 12:11:03 -0400 Received: from mail180-16.suw31.mandrillapp.com ([198.2.180.16]:28481 "EHLO mail180-16.suw31.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbfFIQLD (ORCPT ); Sun, 9 Jun 2019 12:11:03 -0400 X-Greylist: delayed 904 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Jun 2019 12:11:02 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=UBm1Ha65NyTbaemRU67DRfuweZgj6OScpzVWtCG9DoQ=; b=DBR5mcH4BITnmq8lLn/IAa6I6QojJMDQa6fWMqFkkGhUCsQOUFD2L7u65qqpXCC50txgw28h+ijW n/bCz8GAK6P+Sd38GlhafEtnWBxrGl0cVcZMW0pL98D5laeGobLZZyH8as8Nt9y3V3wBbjZ4B4ub b1V1vnh62jPkUV5EZ4k= Received: from pmta03.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail180-16.suw31.mandrillapp.com id hvknpc22sc08 for ; Sun, 9 Jun 2019 15:41: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=1560094867; h=From : Subject : To : Cc : Message-Id : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=UBm1Ha65NyTbaemRU67DRfuweZgj6OScpzVWtCG9DoQ=; b=C836yH92HkPjl/mQBY0/1GtFhoGzuhjGBeWu0tyhgtO/j3GpIkl1XEtE/ah+OK9buar4zl M9xNayrlr58zXpFjK7QorUxHYQCk7HKrJdDo5d/OF/mLKQhGBUV7Kg3tvJgPFDE/DzpeeCyj EdHa8TqpZsjrPA+x8OjlvYDuDbFy0= From: Kirill Smelkov Subject: [PATCH 3.16 0/2] Fix FUSE read/write deadlock on stream-like files Received: from [87.98.221.171] by mandrillapp.com id 75036d3996514147afe781f190e064b3; Sun, 09 Jun 2019 15:41:07 +0000 X-Mailer: git-send-email 2.20.1 To: , Ben Hutchings Cc: Sasha Levin , Greg Kroah-Hartman , Linus Torvalds , Miklos Szeredi , , , Kirill Smelkov Message-Id: <20190609135607.9840-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.75036d3996514147afe781f190e064b3 X-Mandrill-User: md_31050260 Date: Sun, 09 Jun 2019 15:41: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-3.16 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.16 (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