From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: Josef Bacik Cc: axboe@kernel.dk, nbd@other.debian.org, linux-block@vger.kernel.org, kernel-team@fb.com, Josef Bacik Subject: Re: [PATCH] nbd: set discard granularity properly From: "Martin K. Petersen" References: <1511990024-2742-1-git-send-email-josef@toxicpanda.com> Date: Thu, 30 Nov 2017 10:58:54 -0500 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") Message-ID: MIME-Version: 1.0 Content-Type: text/plain List-ID: 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 K. Petersen Oracle Linux Engineering