linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: sedat.dilek@gmail.com
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@kernel.dk>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next <linux-next@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: Tree for Feb 4
Date: Wed, 04 Feb 2015 22:17:54 -0500	[thread overview]
Message-ID: <yq17fvx9hct.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <CA+icZUXrSSeFakX4w5nARo3eh35-p2JwKE5kw4KuuFQkv7dMOg@mail.gmail.com> (Sedat Dilek's message of "Wed, 4 Feb 2015 17:06:45 +0100")

>>>>> "Sedat" == Sedat Dilek <sedat.dilek@gmail.com> 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 <sedat.dilek@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 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);
 }

  reply	other threads:[~2015-02-05  3:18 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04  8:35 linux-next: Tree for Feb 4 Stephen Rothwell
2015-02-04 12:26 ` Sedat Dilek
2015-02-04 15:16   ` Jens Axboe
2015-02-04 15:21     ` Sedat Dilek
2015-02-04 15:31       ` Jens Axboe
2015-02-04 15:36         ` Sedat Dilek
2015-02-04 15:58           ` Martin K. Petersen
2015-02-04 16:06             ` Sedat Dilek
2015-02-05  3:17               ` Martin K. Petersen [this message]
2015-02-05  3:41                 ` Sedat Dilek
2015-02-05 19:46                 ` Sedat Dilek
2015-02-06 15:24                   ` Sedat Dilek
2015-02-04 20:18 ` Sedat Dilek
2015-02-04 21:54   ` Rafael J. Wysocki
2015-02-04 21:53     ` Paul E. McKenney
2015-02-04 22:59       ` Rafael J. Wysocki
2015-02-04 23:51         ` Paul E. McKenney
2015-02-04 23:58           ` Sedat Dilek
2015-02-05  0:10           ` Paul E. McKenney
2015-02-05  0:30             ` Sedat Dilek
2015-02-05  0:57               ` Paul E. McKenney
2015-02-05  1:18                 ` Sedat Dilek
2015-02-05  1:51                   ` Paul E. McKenney
2015-02-05  1:53                     ` Sedat Dilek
2015-02-05  2:12                       ` Sedat Dilek
2015-02-05  4:13                         ` Paul E. McKenney
2015-02-05  7:14                       ` Dave Hansen
2015-02-05 14:37                         ` Paul E. McKenney
2015-02-05 14:57                         ` Sedat Dilek
2015-02-05 16:58                           ` Paul E. McKenney
2015-02-05 18:03                         ` Steven Rostedt
2015-02-05 18:08                           ` Steven Rostedt
2015-02-05 18:11                             ` Dave Hansen
2015-02-05 18:34                               ` Paul E. McKenney
2015-02-05 18:35                                 ` Dave Hansen
2015-02-05 18:45                                   ` Paul E. McKenney
2015-02-05 19:25                                     ` Sedat Dilek
2015-02-05 19:33                                       ` Paul E. McKenney
2015-02-05 19:42                                         ` Sedat Dilek
2015-02-05 19:58                                       ` Steven Rostedt
2015-02-05 20:07                                         ` Sedat Dilek
2015-02-05 20:22                                           ` Steven Rostedt
2015-02-05 20:50                                             ` Sedat Dilek
2015-02-05 21:45                                               ` Sedat Dilek
2015-02-05 22:09                                                 ` Steven Rostedt
2015-02-05 22:16                                                   ` Sedat Dilek
2015-02-05 23:11                                                     ` Steven Rostedt
2015-02-05 23:53                                                       ` Sedat Dilek
2015-02-06  0:03                                                         ` Sedat Dilek
2015-02-06  0:12                                                         ` Steven Rostedt
2015-02-06  0:14                                                           ` Sedat Dilek
2015-02-04 22:38     ` Sedat Dilek
2015-02-04 23:25       ` Rafael J. Wysocki
2015-02-04 23:54         ` Sedat Dilek
2015-02-04 22:46     ` Sedat Dilek
2015-02-04 23:30       ` Rafael J. Wysocki
2015-02-04 23:48         ` Sedat Dilek
  -- strict thread matches above, loose matches on Subject: below --
2022-02-04  4:14 Stephen Rothwell
2021-02-04  9:13 Stephen Rothwell
2020-02-04  4:19 Stephen Rothwell
2019-02-04  5:35 Stephen Rothwell
2016-02-04  3:48 Stephen Rothwell
2014-02-04  5:07 Stephen Rothwell
     [not found] ` <CAP=VYLpgLC_4yuPtQH_yAd8S9cqQAVu2uB2=Wf3q_zgY4uzkLw@mail.gmail.com>
2014-02-04 22:23   ` Stephen Rothwell
2014-02-05  0:41 ` Stephen Rothwell
2013-02-04  7:39 Stephen Rothwell
2013-02-04 13:56 ` James Hogan
2013-02-04 20:33   ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yq17fvx9hct.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sedat.dilek@gmail.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).