All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: axboe@kernel.dk, nbd@other.debian.org,
	linux-block@vger.kernel.org, kernel-team@fb.com,
	Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH] nbd: set discard granularity properly
Date: Thu, 30 Nov 2017 10:58:54 -0500	[thread overview]
Message-ID: <yq1h8tbg3lt.fsf@oracle.com> (raw)
In-Reply-To: <1511990024-2742-1-git-send-email-josef@toxicpanda.com> (Josef Bacik's message of "Wed, 29 Nov 2017 16:13:44 -0500")


Josef,

> For some reason we had discard granularity set to 512 always even when
> discards were disabled.  Fix this by having the default be 0, and then
> if we turn it on set the discard granularity to the blocksize.

Originally, discard_max_bytes was the queue limit used to indicate
whether discards were supported or not. Callers were supposed to check
that for a value bigger than 0 before interpreting granularity and
alignment. However, many callers triggered on discard_granularity > 0
instead, and as a result things have been muddled somewhat.

So I don't have a problem with only reporting granularity when the
feature is actually enabled...

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2017-11-30 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 21:13 [PATCH] nbd: set discard granularity properly Josef Bacik
2017-11-30 15:58 ` Martin K. Petersen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-23 17:35 Josef Bacik
2018-05-23 21:27 ` Jens Axboe

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=yq1h8tbg3lt.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=nbd@other.debian.org \
    /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.