From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:34714 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbeJZQUN (ORCPT ); Fri, 26 Oct 2018 12:20:13 -0400 Date: Fri, 26 Oct 2018 09:44:15 +0200 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, Rui Salvaterra , stable@vger.kernel.org, Mike Snitzer , Christoph Hellwig , Xiao Ni , Mariusz Dabrowski Subject: Re: [PATCH 1/3] block: make sure discard bio is aligned with logical block size Message-ID: <20181026074415.GA4660@lst.de> References: <20181026062435.21398-1-ming.lei@redhat.com> <20181026062435.21398-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181026062435.21398-2-ming.lei@redhat.com> Sender: stable-owner@vger.kernel.org List-ID: > if (req_sects > UINT_MAX >> 9) > - req_sects = UINT_MAX >> 9; > + req_sects = (UINT_MAX >> 9) & ~bs_mask; Given that we have this same thing duplicated in write zeroes what about a documented helper?