From patchwork Sat Apr 2 07:23:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 885 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:47:02 -0000 Delivered-To: patches@linaro.org Received: by 10.68.42.69 with SMTP id m5cs1958pbl; Sat, 2 Apr 2011 00:24:11 -0700 (PDT) Received: by 10.43.47.195 with SMTP id ut3mr3892637icb.426.1301729050526; Sat, 02 Apr 2011 00:24:10 -0700 (PDT) Received: from VA3EHSOBE002.bigfish.com (va3ehsobe002.messaging.microsoft.com [216.32.180.12]) by mx.google.com with ESMTPS id vu5si7989990icb.139.2011.04.02.00.24.10 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Apr 2011 00:24:10 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.180.12 is neither permitted nor denied by best guess record for domain of R65037@freescale.com) client-ip=216.32.180.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.12 is neither permitted nor denied by best guess record for domain of R65037@freescale.com) smtp.mail=R65037@freescale.com Received: from mail126-va3-R.bigfish.com (10.7.14.243) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 14.1.225.8; Sat, 2 Apr 2011 07:24:08 +0000 Received: from mail126-va3 (localhost.localdomain [127.0.0.1]) by mail126-va3-R.bigfish.com (Postfix) with ESMTP id 2547CF502EC; Sat, 2 Apr 2011 07:24:05 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzbb2cKzz1202hzz8275bhed1kz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail126-va3 (localhost.localdomain [127.0.0.1]) by mail126-va3 (MessageSwitch) id 1301729044941686_16744; Sat, 2 Apr 2011 07:24:04 +0000 (UTC) Received: from VA3EHSMHS033.bigfish.com (unknown [10.7.14.248]) by mail126-va3.bigfish.com (Postfix) with ESMTP id C6148858060; Sat, 2 Apr 2011 07:24:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS033.bigfish.com (10.7.99.43) with Microsoft SMTP Server (TLS) id 14.1.225.8; Sat, 2 Apr 2011 07:23:57 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.270.2; Sat, 2 Apr 2011 02:23:56 -0500 Received: from x-VirtualBox.ap.freescale.net (x-VirtualBox.ap.freescale.net [10.192.242.110]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p327Nl6C019485; Sat, 2 Apr 2011 02:23:53 -0500 (CDT) From: Richard Zhu To: CC: , , , , , , Richard Zhu Subject: [PATCH RFC] RAMDISK: doing write barrier will return -EIO Date: Sat, 2 Apr 2011 15:23:45 +0800 Message-ID: <1301729025-2647-2-git-send-email-Hong-Xing.Zhu@freescale.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1301729025-2647-1-git-send-email-Hong-Xing.Zhu@freescale.com> References: <1301729025-2647-1-git-send-email-Hong-Xing.Zhu@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com when doing write barrier, the data of the bio is NULL, it's OK for ramdisk doing nothing, So the result of the bio must be success. Signed-off-by: Richard Zhu --- drivers/block/brd.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index b7f51e4..8d4964c 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -335,12 +335,14 @@ static int brd_make_request(struct request_queue *q, struct bio *bio) struct bio_vec *bvec; sector_t sector; int i; - int err = -EIO; + int err = 0; sector = bio->bi_sector; if (sector + (bio->bi_size >> SECTOR_SHIFT) > - get_capacity(bdev->bd_disk)) + get_capacity(bdev->bd_disk)) { + err = -EIO; goto out; + } if (unlikely(bio->bi_rw & REQ_DISCARD)) { err = 0;