From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 14 Feb 2017 00:23:14 -0800 From: Christoph Hellwig To: Damien Le Moal Cc: Jens Axboe , linux-block@vger.kernel.org, Shaun Tancheff Subject: Re: [PATCH] sd: Check for unaligned partial completion Message-ID: <20170214082314.GA31838@infradead.org> References: <20170214081030.24558-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170214081030.24558-1-damien.lemoal@wdc.com> List-ID: > + unsigned int sector_sz = SCpnt->device->sector_size; Can you spell out size? > + /* > + * In case of bogus fw or device, we could end up having > + * unaligned partial completion. Check this here. > + */ > + resid = scsi_get_resid(SCpnt); > + if (SCpnt->request->cmd_type == REQ_TYPE_FS && > + resid & (sector_sz - 1)) { ->done is only called for fs requests, so you can remove this check.