From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: [PATCH 12/23] sd: handle REQ_UNMAP Date: Thu, 30 Mar 2017 11:28:32 -0400 Message-ID: References: <20170323143341.31549-1-hch@lst.de> <20170323143341.31549-13-hch@lst.de> <1490719722.2573.8.camel@sandisk.com> <20170330090201.GD12015@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <20170330090201.GD12015-jcswGhMUV9g@public.gmane.org> (hch-jcswGhMUV9g@public.gmane.org's message of "Thu, 30 Mar 2017 11:02:01 +0200") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: drbd-dev-bounces-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org Errors-To: drbd-dev-bounces-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org To: "hch@lst.de" Cc: "axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org" , "linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org" , "snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "philipp.reisner-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org" , "linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Bart Van Assche , "lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org" , "shli-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org" List-Id: dm-devel.ids ImhjaEBsc3QuZGUiIDxoY2hAbHN0LmRlPiB3cml0ZXM6CgpDaHJpc3RvcGgsCgo+IE9uIFR1ZSwg TWFyI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che , "agk\@redhat.com" , "lars.ellenberg\@linbit.com" , "snitzer\@redhat.com" , "martin.petersen\@oracle.com" , "philipp.reisner\@linbit.com" , "axboe\@kernel.dk" , "shli\@kernel.org" , "linux-scsi\@vger.kernel.org" , "dm-devel\@redhat.com" , "drbd-dev\@lists.linbit.com" , "linux-block\@vger.kernel.org" , "linux-raid\@vger.kernel.org" Subject: Re: [PATCH 12/23] sd: handle REQ_UNMAP From: "Martin K. Petersen" References: <20170323143341.31549-1-hch@lst.de> <20170323143341.31549-13-hch@lst.de> <1490719722.2573.8.camel@sandisk.com> <20170330090201.GD12015@lst.de> Date: Thu, 30 Mar 2017 11:28:32 -0400 In-Reply-To: <20170330090201.GD12015@lst.de> (hch@lst.de's message of "Thu, 30 Mar 2017 11:02:01 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 List-ID: "hch@lst.de" writes: Christoph, > On Tue, Mar 28, 2017 at 04:48:55PM +0000, Bart Van Assche wrote: >> > if (sdp->no_write_same) >> > return BLKPREP_INVALID; >> > if (sdkp->ws16 || sector > 0xffffffff || nr_sectors > 0xffff) >>=20 >> Users can change the provisioning mode from user space from=C2=A0SD_LBP_= WS16 into >> SD_LBP_WS10 so I'm not sure it's safe to skip the (sdkp->ws16 || sector > >> 0xffffffff || nr_sectors > 0xffff) check if REQ_UNMAP is set. > > They can, and if the device has too many sectors that will already cause > discard to fail, I'm not sure I understand what you mean by that? --=20 Martin K. Petersen Oracle Linux Engineering From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id E07101056320 for ; Thu, 30 Mar 2017 17:28:43 +0200 (CEST) To: "hch\@lst.de" From: "Martin K. Petersen" References: <20170323143341.31549-1-hch@lst.de> <20170323143341.31549-13-hch@lst.de> <1490719722.2573.8.camel@sandisk.com> <20170330090201.GD12015@lst.de> Date: Thu, 30 Mar 2017 11:28:32 -0400 In-Reply-To: <20170330090201.GD12015@lst.de> (hch@lst.de's message of "Thu, 30 Mar 2017 11:02:01 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "axboe@kernel.dk" , "linux-raid@vger.kernel.org" , "martin.petersen@oracle.com" , "snitzer@redhat.com" , "philipp.reisner@linbit.com" , "linux-block@vger.kernel.org" , "dm-devel@redhat.com" , "linux-scsi@vger.kernel.org" , Bart Van Assche , "lars.ellenberg@linbit.com" , "shli@kernel.org" , "agk@redhat.com" , "drbd-dev@lists.linbit.com" Subject: Re: [Drbd-dev] [PATCH 12/23] sd: handle REQ_UNMAP List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , "hch@lst.de" writes: Christoph, > On Tue, Mar 28, 2017 at 04:48:55PM +0000, Bart Van Assche wrote: >> > if (sdp->no_write_same) >> > return BLKPREP_INVALID; >> > if (sdkp->ws16 || sector > 0xffffffff || nr_sectors > 0xffff) >>=20 >> Users can change the provisioning mode from user space from=C2=A0SD_LBP_= WS16 into >> SD_LBP_WS10 so I'm not sure it's safe to skip the (sdkp->ws16 || sector > >> 0xffffffff || nr_sectors > 0xffff) check if REQ_UNMAP is set. > > They can, and if the device has too many sectors that will already cause > discard to fail, I'm not sure I understand what you mean by that? --=20 Martin K. Petersen Oracle Linux Engineering