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: 655645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s4WB50kJ2z9t0P for ; Thu, 4 Aug 2016 10:33:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=seagate.com header.i=@seagate.com header.b=ph2J4kEK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=seagate.com header.i=@seagate.com header.b=Xen0YIEm; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=seagate.com header.i=@seagate.com header.b=JQM/f4Ye; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bV6ZB-0003tG-At; Thu, 04 Aug 2016 00:31:17 +0000 Received: from mx0b-00003501.pphosted.com ([67.231.152.68] helo=mx0a-000cda01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bV6Z7-0003jl-TY for linux-mtd@lists.infradead.org; Thu, 04 Aug 2016 00:31:15 +0000 Received: from pps.filterd (m0075034.ppops.net [127.0.0.1]) by mx0b-00003501.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u740RTZd010496 for ; Wed, 3 Aug 2016 20:30:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=seagate.com; h=mime-version : in-reply-to : references : from : date : message-id : subject : to : cc : content-type; s=s2016050306; bh=B7huOIrn4mLQTR7vic5j4jla/BHxWsyZon0JWV3Ygwg=; b=ph2J4kEKXzmXzUCO8APonKSctKYN8dCDeET7kK1KyRbQGxn8wjj1e/B2O9kKuWS5atUB sjpYRKoCTsAWfDZ4/Ptvfi/yH7mrtOZ9gK+4cAi65oks4rJ7q55/6kDLsCfVpGbWRn6p tcgYFQ6FZslLAg1C/mZIq3yUfSd/GIhV9UNS6fJ8jkmi4OlJonEb4ufi2tbqTJOE6mWh Fr4QoLiO4I6Mlc8XYVeUun61YdhoJxPX6vxtr9RuxhzmpU53ur63b2z3lYQw0A9rVYJ/ 1No8KCFRU1W9bwD/GB+b2kaKhV5BcCmoP+aP/VluD0oZ8Dknj/E9A4cVR4x3V2fvzs9u gA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=seagate.com; h=mime-version : in-reply-to : references : from : date : message-id : subject : to : cc : content-type; s=proofpoint; bh=B7huOIrn4mLQTR7vic5j4jla/BHxWsyZon0JWV3Ygwg=; b=Xen0YIEmhVbFRfzbhQFqduw2RcwMxgV7ED4Xvv7zaO1fONJV/ilfFJj4PxtEcYbFq8gO crda4tHySupkFKFFY19Ryu5O7S0RF39S/RuS5RHH+1qvTwU0/XrCnQANJncQjvIOB70I nDtqv+FgLNPU+S/sX27UUCdoP+BdE1x/yZulzF0VO6nQRtjxRmFg/tu/1nz/TrkK6B+H wq75hhq3vgKMuq+ySm27zQuZadPyKVfXx7Y/J+UYh0uEa4P4Vmp3Lu7FuIrNMQwnGmpu RNICSe7Kv0GWj13pkNKBTDyv9DAit++f347/zBrCBZq96Ld49OP7fnYwIOtGXv0widZD kg== Authentication-Results: seagate.com; dkim=pass header.s="google" header.d=seagate.com Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by mx0b-00003501.pphosted.com with ESMTP id 24ktbr08uy-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-f198.google.com with SMTP id 93so386121880qtg.1 for ; Wed, 03 Aug 2016 17:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seagate.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=96g5QOCn2AsIXj134OpL/MPc89ZpHnFxQ4DAOdlTzL8=; b=JQM/f4YedCTl5dM02f0R8Oqexn8P1MyDm6C4MhqLuesuzmPprUEDsWLoFweN2G6ym+ gD3SKjMj/EXQ87I02Rjy+6rFuRGKyILaLLcLdDCkEE4rqwXobW5ZEAJzQkChf96+93Wm Fiyyr9nKnPXWWCWuDdWmClyQhvFIdogvdZzR7FRGw7Grc82BlXesHGNbNfN8c3XOFI7y nh1vfUzhSG4k6wpTCJ4x0FxFze6NTyxm5f6a9PwdsajxvCt+NAe6f6f4qz2GGOce/K8K 07/c3CvrHcJPZ7EEXLzq/fN1x51h+Sb5ga+ZnpcvopVt9FHrbuW4xvBRAf1dy9l7dKoK zxlA== 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=MPJP5BaeH7oVAb/Hbu04q/cpi26EKGGg/Ya0/RctRvyhf2FizBIxK16/bWZGpG38X1 V9RnxeRzQRAxLqUC0kIKnIfhme/Kv0QM01v4X5SL3KOILRYDjCj3gORs160ww69qmBwI VBnBYj4omyBZoRW4ZwSVpeebSnzWE9jT4fPIsNUmoigk9DeBcdkGQoaMa+XR3gg3Rut6 +dviSk2rD/YrV+XxDYsf1l8iKo3vQEg1s2eCWjjb5yZU42ld+qL9Agf2wdJz++XeKozS 70g0rXU6criaxG4yZCkVV6MAuQlbWKDx8PE0kG5pPQydsUdUsJQmyinxt9JZZCi/ahgm kv2w== X-Gm-Message-State: AEkoouvP1y12R/HNGjoLzPLXSq3kh2k+Dz45dP37I8czN/cJ/VkFdY+t4M12echYF+Gvn/FsO8TVxUg8HQrjpDH7DIta1TwYP12so95qTq7cSJB+8ed+ATJ1XrTV4HQvmn6tM9dQnobR4IceZ92wnYrgVi9oMTFE5UzCDv0mkC1cbfMeBVxlMIrhBq0ZPw== X-Received: by 10.37.208.74 with SMTP id h71mr6092022ybg.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: Subject: Re: [PATCH 37/45] drivers: use req op accessor 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160803_173114_225948_4E2568FC X-CRM114-Status: GOOD ( 16.88 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [67.231.152.68 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [67.231.152.68 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;