From patchwork Thu Aug 4 00:30:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaun Tancheff X-Patchwork-Id: 9262429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 846F06048B for ; Thu, 4 Aug 2016 00:32:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7306027FA2 for ; Thu, 4 Aug 2016 00:32:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 661152807E; Thu, 4 Aug 2016 00:32:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E963527FA2 for ; Thu, 4 Aug 2016 00:32:28 +0000 (UTC) Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u740Vk6V018676 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Aug 2016 00:31:46 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u740VQHe015128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Aug 2016 00:31:27 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1bV6ZK-0005ga-J8; Wed, 03 Aug 2016 17:31:26 -0700 Received: from userv0022.oracle.com ([156.151.31.74]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1bV6Ys-0005fu-JA for ocfs2-devel@oss.oracle.com; Wed, 03 Aug 2016 17:30:59 -0700 Received: from aserp1060.oracle.com (aserp1060.oracle.com [141.146.126.71]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u740Usgw014290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 4 Aug 2016 00:30:54 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp1060.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u740UrUu000592 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 4 Aug 2016 00:30:53 GMT Authentication-Results: aserp1060.oracle.com; dkim=pass reason="2048-bit key" header.d=seagate.com header.i=@seagate.com header.b=ph2J4kEK Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.11/8.16.0.11) with SMTP id u740UpjT002147 for ; Thu, 4 Aug 2016 00:30:53 GMT Authentication-Results: oracle.com; spf=pass smtp.mail=shaun.tancheff@seagate.com Received: from mx0a-000cda01.pphosted.com (mx0b-00003501.pphosted.com [67.231.152.68]) by userp2040.oracle.com with ESMTP id 24kk9ufrcx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Aug 2016 00:30:52 +0000 Received: from pps.filterd (m0075030.ppops.net [127.0.0.1]) by mx0b-00003501.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u740RarB007957 for ; Wed, 3 Aug 2016 20:30:51 -0400 Authentication-Results: seagate.com; dkim=pass header.s="google" header.d=seagate.com Received: from mail-qt0-f200.google.com (mail-qt0-f200.google.com [209.85.216.200]) by mx0b-00003501.pphosted.com with ESMTP id 24ks598na3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 03 Aug 2016 20:30:51 -0400 Received: by mail-qt0-f200.google.com with SMTP id i27so384364979qte.3 for ; Wed, 03 Aug 2016 17:30:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=96g5QOCn2AsIXj134OpL/MPc89ZpHnFxQ4DAOdlTzL8=; b=hWGTjxOoUaSvs0qBFL1E/z5ceNEj0Juo/UbGgEVQ4Qxxdwf/9c4d8YGgHxM7fA+cgT 9rCfA5sJrSy51y14Db1h4zLVwmg8PwO08s7MqElZaldnd9c8HTRuGud10Vb2F3vCaoj+ RhblUN+AFreIK7dXem6G2CSpotIfw6W23qKPRXuzCg5tBLlghbFiiZ8VvmNaGdx7ajS0 uILDMpZxBzGoa+GEK61FVHa38ymiriZ7YsiN0B+1JhW/vj0qzHokHnhzgzc5hTK8+gGy r7rVii4lSAKbyursrb/VAqbn7P0LLeAHJAMXPaVejBrGFp3OH9VaudGxmeYkWbl63fRc sMTg== X-Gm-Message-State: AEkoout2rG6ATYKS+FZh9cwCjabEu+EY/I31n7Uq4ZSykF58EloyLHU76TrbJXmxcalLdc4WcuPvfEhh3GymnBvlE1+4eBo2uw6AaJI3prJJkrdDPoFml9uxADbPsZC4waufezzoV70T4OkLxBTDJmPJay8q//9Lad+Pkwhxu043n4Z0v/heohkSEA== X-Received: by 10.37.208.74 with SMTP id h71mr6092026ybg.146.1470270650374; Wed, 03 Aug 2016 17:30:50 -0700 (PDT) X-Received: by 10.37.208.74 with SMTP id h71mr6092000ybg.146.1470270650131; Wed, 03 Aug 2016 17:30:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.132.199 with HTTP; Wed, 3 Aug 2016 17:30:29 -0700 (PDT) In-Reply-To: <87fbe31f-27b3-ff7a-e381-34fc1aad337e@redhat.com> References: <1465155145-10812-1-git-send-email-mchristi@redhat.com> <1465155145-10812-38-git-send-email-mchristi@redhat.com> <87fbe31f-27b3-ff7a-e381-34fc1aad337e@redhat.com> From: Shaun Tancheff Date: Wed, 3 Aug 2016 19:30:29 -0500 Message-ID: To: Mike Christie X-Proofpoint-PolicyRoute: Outbound X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-03_16:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608040003 X-Proofpoint-Spam-Policy: Default Domain Policy X-ServerName: mx0b-00003501.pphosted.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:67.231.144.15 ip4:67.231.152.68 include:_spf2.seagate.com include:_spf3.seagate.com include:_spf.google.com include:spf.mandrillapp.com ip4:54.240.8.0/24 ip4:216.235.253.67 ~all X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8246 signatures=670725 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608040004 Cc: Dave Chinner , philipp.reisner@linbit.com, dm-devel@redhat.com, target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com, linux-scsi@vger.kernel.org, Ross Zwisler , linux-ext4 , konrad.wilk@oracle.com, XFS Developers , linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, osd-dev@open-osd.org, Ross Zwisler , Jens Axboe , LKML , linux-f2fs-devel@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, linux-fsdevel , lars.ellenberg@linbit.com, linux-btrfs@vger.kernel.org Subject: Re: [Ocfs2-devel] [PATCH 37/45] drivers: use req op accessor X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Aug 3, 2016 at 6:47 PM, Mike Christie wrote: > On 08/03/2016 05:33 PM, Ross Zwisler wrote: >> On Sun, Jun 5, 2016 at 1:32 PM, wrote: >>> From: Mike Christie >>> >>> The req operation REQ_OP is separated from the rq_flag_bits >>> definition. This converts the block layer drivers to >>> use req_op to get the op from the request struct. >>> >>> Signed-off-by: Mike Christie >>> --- >>> drivers/block/loop.c | 6 +++--- >>> drivers/block/mtip32xx/mtip32xx.c | 2 +- >>> drivers/block/nbd.c | 2 +- >>> drivers/block/rbd.c | 4 ++-- >>> drivers/block/xen-blkfront.c | 8 +++++--- >>> drivers/ide/ide-floppy.c | 2 +- >>> drivers/md/dm.c | 2 +- >>> drivers/mmc/card/block.c | 7 +++---- >>> drivers/mmc/card/queue.c | 6 ++---- >> >> Dave Chinner reported a deadlock with XFS + DAX, which I reproduced >> and bisected to this commit: >> >> commit c2df40dfb8c015211ec55f4b1dd0587f875c7b34 >> Author: Mike Christie >> Date: Sun Jun 5 14:32:17 2016 -0500 >> drivers: use req op accessor >> >> Here are the steps to reproduce the deadlock with a BRD ramdisk: >> >> mkfs.xfs -f /dev/ram0 >> mount -o dax /dev/ram0 /mnt/scratch > > When using ramdisks, we need the attached patch like in your other bug > report. I think it will fix some hangs people are seeing. > > I do not think that it should cause the failure to run issue you saw > when doing generic/008 and ext2. > I think the translation in loop.c is suspicious here: "if use DIO && not (a flush_flag or discard_flag)" should translate to: "if use DIO && not ((a flush_flag) || op == discard)" But in the patch I read: "if use DIO && ((not a flush_flag) || op == discard) Which would have DIO && discards follow the AIO path? So I would humbly suggest something like the following (on top of commit c2df40dfb8c015211ec55f4b1dd0587f875c7b34): [Please excuse the messed up patch format ... gmail eats tabs] diff --git a/drivers/block/loop.c b/drivers/block/loop.c index b9b737c..0754d83 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1659,8 +1659,9 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, if (lo->lo_state != Lo_bound) return -EIO; - if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) || - req_op(cmd->rq) == REQ_OP_DISCARD)) + if (lo->use_dio && !( + (cmd->rq->cmd_flags & REQ_FLUSH) || + req_op(cmd->rq) == REQ_OP_DISCARD)) cmd->use_aio = true; else cmd->use_aio = false;