[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160425212325.GA20950@soda.linbit>
Date: Mon, 25 Apr 2016 23:23:25 +0200
From: Lars Ellenberg <lars.ellenberg@...bit.com>
To: Philipp Reisner <philipp.reisner@...bit.com>,
Bart Van Assche <bart.vanassche@...disk.com>,
Jens Axboe <axboe@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"drbd-dev@...ts.linbit.com" <drbd-dev@...ts.linbit.com>
Subject: Re: [PATCH 11/30] drbd: when receiving P_TRIM, zero-out partial
unaligned chunks
On Mon, Apr 25, 2016 at 02:07:38PM +0200, Philipp Reisner wrote:
> + max_discard_sectors = min(q->limits.max_discard_sectors, (1U << 22));
> + max_discard_sectors -= max_discard_sectors % granularity;
^^^^ there
On Mon, Apr 25, 2016 at 10:32:17PM +0200, Lars Ellenberg wrote:
> On Mon, Apr 25, 2016 at 09:37:28AM -0700, Bart Van Assche wrote:
> > On 04/25/2016 05:13 AM, Philipp Reisner wrote:
> > >+ while (nr_sectors >= granularity) {
> > >+ nr = min_t(sector_t, nr_sectors, max_discard_sectors);
> > >+ err |= blkdev_issue_discard(bdev, start, nr, GFP_NOIO, 0);
> > >+ nr_sectors -= nr;
> > >+ start += nr;
> > >+ }
> >
> > Hello Phil,
> >
> > In blk_bio_discard_split() the following statement protects against
> > block drivers for which max_discard_sectors is not a multiple of the
> > discard granularity:
> >
> > max_discard_sectors -= max_discard_sectors % granularity;
> >
> > Do we need something similar in the above loop?
>
> Right. Did not realize that was "legal".
Wait. We already have that. see above.
Lars
Powered by blists - more mailing lists