All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Hannes Reinecke <hare@suse.com>, Jens Axboe <axboe@fb.com>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()
Date: Mon, 16 Oct 2017 04:44:51 -0700	[thread overview]
Message-ID: <20171016114451.GA14591@infradead.org> (raw)
In-Reply-To: <CAOi1vP9P6TrVpMQr9C+YU07uT2dKCZLBfrnMWYpsqYzTQcxBzQ@mail.gmail.com>

On Fri, Oct 06, 2017 at 02:31:20PM +0200, Ilya Dryomov wrote:
> This would unconditionally overwrite any WRITE ZEROS error.  If we get
> e.g. -EIO, and manual zeroing is not allowed, I don't think we want to
> return -EOPNOTSUPP?
> 
> Returning -EOPNOTSUPP to mean "can't zero using either method" doesn't
> make sense to me, because manual zeroing is always supported, just not
> always allowed.

Then thow the throw bdev_write_zeroes_sectors check back in:

	if (ret && try_write_zeroes) {
                if (!(flags & BLKDEV_ZERO_NOFALLBACK))
                        try_write_zeroes = false;
                        goto retry;
                }
		if (!bdev_write_zeroes_sectors(bdev))
	                ret = -EOPNOTSUPP;
        }

The important bit is that the structure in the current patch where the
bdev_write_zeroes_sectors check is on the same level as the method
selection is extremely confusing.

  parent reply	other threads:[~2017-10-16 11:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 15:03 [PATCH v2 0/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout() Ilya Dryomov
2017-10-04 15:03 ` [PATCH v2 1/2] block: factor out __blkdev_issue_zero_pages() Ilya Dryomov
2017-10-05 17:05   ` Christoph Hellwig
2017-10-04 15:03 ` [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout() Ilya Dryomov
2017-10-05 17:13   ` Christoph Hellwig
2017-10-05 19:32     ` Ilya Dryomov
2017-10-06 12:05       ` Christoph Hellwig
2017-10-06 12:31         ` Ilya Dryomov
2017-10-16  8:17           ` Ilya Dryomov
2017-10-16 11:44           ` Christoph Hellwig [this message]
2017-10-16 14:03             ` Ilya Dryomov

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=20171016114451.GA14591@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@fb.com \
    --cc=hare@suse.com \
    --cc=idryomov@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.