From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sedat Dilek Subject: Re: linux-next: Tree for Feb 4 Date: Fri, 6 Feb 2015 16:24:13 +0100 Message-ID: References: <20150204193535.58f132c5@canb.auug.org.au> <54D237D9.4070209@kernel.dk> <54D23B58.9000703@kernel.dk> Reply-To: sedat.dilek@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-wi0-f181.google.com ([209.85.212.181]:61566 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754008AbbBFPYO (ORCPT ); Fri, 6 Feb 2015 10:24:14 -0500 In-Reply-To: Sender: linux-next-owner@vger.kernel.org List-ID: To: "Martin K. Petersen" Cc: Jens Axboe , Stephen Rothwell , linux-next , LKML On Thu, Feb 5, 2015 at 8:46 PM, Sedat Dilek wrote: > On Thu, Feb 5, 2015 at 4:17 AM, Martin K. Petersen > wrote: >>>>>>> "Sedat" == Sedat Dilek writes: >> >> Sedat> No, but I am here on a so-called WUBI installation which >> Sedat> triggered some bugs being an exotic installation. My >> Sedat> Ubuntu/precise is a 18GiB image laying on my Win7 partition >> Sedat> (/dev/sda2). >> >> I've been mulling over this for a while and can't come up with a good >> approach. So let's just nuke these warnings. >> >> -- >> Martin K. Petersen Oracle Linux Engineering >> >> >> block: Quiesce zeroout wrapper >> >> blkdev_issue_zeroout() printed a warning if a device failed a discard or >> write same request despite advertising support for these. That's fine >> for SCSI since we'll disable these commands if we get an error back from >> the disk saying that they are not supported. And consequently the >> warning only gets printed once. >> >> There are other types of block devices that support discard, however, >> and these may return -EOPNOTSUPP for each command but leave discard >> enabled in the queue limits. This will cause a warning message for every >> blkdev_issue_zeroout() invocation. >> >> Remove the offending warning messages. >> >> Reported-by: Sedat Dilek >> Signed-off-by: Martin K. Petersen >> --- >> block/blk-lib.c | 26 +++++++------------------- >> 1 file changed, 7 insertions(+), 19 deletions(-) >> >> diff --git a/block/blk-lib.c b/block/blk-lib.c >> index 715e948f58a4..7688ee3f5d72 100644 >> --- a/block/blk-lib.c >> +++ b/block/blk-lib.c >> @@ -286,7 +286,6 @@ static int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, >> * @discard: whether to discard the block range >> * >> * Description: >> - >> * Zero-fill a block range. If the discard flag is set and the block >> * device guarantees that subsequent READ operations to the block range >> * in question will return zeroes, the blocks will be discarded. Should >> @@ -303,26 +302,15 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, >> sector_t nr_sects, gfp_t gfp_mask, bool discard) >> { >> struct request_queue *q = bdev_get_queue(bdev); >> - unsigned char bdn[BDEVNAME_SIZE]; >> - >> - if (discard && blk_queue_discard(q) && q->limits.discard_zeroes_data) { >> >> - if (!blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, 0)) >> - return 0; >> - >> - bdevname(bdev, bdn); >> - pr_warn("%s: DISCARD failed. Manually zeroing.\n", bdn); >> - } >> + if (discard && blk_queue_discard(q) && q->limits.discard_zeroes_data && >> + blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, 0) == 0) >> + return 0; >> >> - if (bdev_write_same(bdev)) { >> - >> - if (!blkdev_issue_write_same(bdev, sector, nr_sects, gfp_mask, >> - ZERO_PAGE(0))) >> - return 0; >> - >> - bdevname(bdev, bdn); >> - pr_warn("%s: WRITE SAME failed. Manually zeroing.\n", bdn); >> - } >> + if (bdev_write_same(bdev) && >> + blkdev_issue_write_same(bdev, sector, nr_sects, gfp_mask, >> + ZERO_PAGE(0)) == 0) >> + return 0; >> >> return __blkdev_issue_zeroout(bdev, sector, nr_sects, gfp_mask); >> } > > Martin, will you send a separate patch for that? > > Thanks. > Just for the sake of completeness, the patch is now in block-next: commit 9f9ee1f2b2f94f19437ae2def7c0d6636d7fe02e "block: Quiesce zeroout wrapper" - Sedat - [1] http://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git/commit/?h=for-next&id=9f9ee1f2b2f94f19437ae2def7c0d6636d7fe02e