From nobody Wed Feb 11 16:26:17 2026 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06C92C0F84 for ; Wed, 11 Feb 2026 01:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770774703; cv=none; b=NQFJ28377rILGpLkRTB1HFbnFV9FM35/nieGVBW4f9AAq+kCmQ2Btd1bMU7E4I+XLqY8F1PxDSgBcgc86QvrBPOzu+P3Xaoo0pzGiRZOhrDQI3O6xRhOxzzmMiqYspA0AQ6mKmh+Hne4PwUd9SRZ2xD/DxNec9e5xnSovCuMlCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770774703; c=relaxed/simple; bh=aeazTpxisGRJ4cM7R4dFbxvIEp42mH8LnFF3RNc2J/8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=begpzxmsPUtQX/2aRtJKY/x9tHO4G6ILFPeIuhQRnQ/7flM4Q8VZTVo3QOszsFo/wzIVpUrzQkSlkPhIV72kFuhnYR7oX0NuBU14k9hPOWnWx3cRatIllS8ZU8HXiqYJ7ulSiV/lL4BUyD4yjAtStK0FPDl8iLsYN7XuF1NWRBQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J8/1joD/; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J8/1joD/" Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-78fc4425b6bso15026087b3.1 for ; Tue, 10 Feb 2026 17:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770774701; x=1771379501; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lGhMFSn6RfxMnoUYJqlK2uZRccorF8Z8vHJFhcv6GqU=; b=J8/1joD/xXreqabLnuhqZNMxGzTcElOvGEBiEySjowZ/Dh4xcnmMRWxrufQIF8K7Z3 sHvbt0h2Bl0M5sxwxWjspfbEOU75d7g9znaZICPscbpOWZ2pe40pET0DBss3uQXg3kS/ xBWcrd3JDBQ9Eub90vCzVazFpAmXP0BU4emKJfYHMcCHFGa0A4aMfOeCM/rBF3iXrvDn g3/nKicTDVr43KJ8jP2zDPDfXJhorzjO10+IAwRInnCb31kPhx+7jxJkKot4mPO2k3+e oZ1KblD2NosxAx5QB8eQNt77Vo8RTK4YdOycrGk52OnvsBYbo2yQM+7ECCJNFDwC2kZP Mi2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770774701; x=1771379501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lGhMFSn6RfxMnoUYJqlK2uZRccorF8Z8vHJFhcv6GqU=; b=AnSIoaOe4fQweiKJnA1VbclgBAbhefmBuqzzAgrkMpXxrKKkeCkNgQaLm3f7gBwPjH 70WylZiWaver3irUA4bfDNzqnmYxNIdjE4AcuCSD+u0aSmieEKuY468ucWjKsv86X4aY r0pD5t6MQgfNTyaYv7PiNpiHKn5fKMpBGtTj/qFah53Tdpj33PF0r0YB+/FxCljhijiI PagzvqA8fCNrTdogP/Kuj4EfI+clr6gQ2I5sVsEqr4aXfH1PLycbEPYAm9Fd0wVzBUTL RZAq5hrf1ajPRiAtCXt5+W3I7VQGVIcQJMGWZ5UX3xDpnACxeiWS3U1xgJN7BhR5dQca Nbvw== X-Gm-Message-State: AOJu0YzlngO2u/jK1P17y7kQg50mKhn8PfM8hQv4XEUfRtJQrbva+SXs +02MDNf99k3vhe5GH5csbyMVhbuOKMIaEEZsk1OByY/BfWvf9N+8O6ZyLca80Q== X-Gm-Gg: AZuq6aKrXsimQzEF1+otURScWfXKE6I7xiOD32/ffyrvHKGiXnDw9/EXQWXNMJveBJ7 n4TA6bUzIlmUHZXpXTLo5ovfcGrMHxNlL8MV5LAIv5TZBO2njkfcfO/TXIDbx8/a/575lmTD6U5 91fly4PkzSAmeMDufC3L1/haAf5uSSXQSdz7clTk3b4umAZcSSzyPcAIazaRVDXPp9OGHEJROPI Fa9qyARDzXYEKOl6pnpV+Bl0BwQRetxKoo6Jxr1PHhhHoG9/RHeF4E7SxgqOx71VwS8aS4emOSF 05Xr2qnrxQv66p38cWUa8q9wA8H+JUZy8WodHh9TRGU0gSLMzUsdPYkpbBY5Wm8KDRI67cKHIH5 LMEzSwidffT6Sk1nSz7mPMCtxWyIl6EJiLLOCu+MvKMjhsiTiXY+aMvQFOGsbCLsSYhRySLgtTH Xs4d7t8tkJnSfE5Jw5KI3Zb5WAAqfjhMMbuR5V1uduNX5Oces= X-Received: by 2002:a05:690c:102:b0:796:3842:acc5 with SMTP id 00721157ae682-7963842e384mr109295857b3.41.1770774700832; Tue, 10 Feb 2026 17:51:40 -0800 (PST) Received: from 5163NRD-SPRABHU.ssi.samsung.com ([50.205.20.42]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7966c16e7c6sm3751557b3.1.2026.02.10.17.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 17:51:40 -0800 (PST) From: sw.prabhu6@gmail.com To: James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mcgrof@kernel.org, pankaj.raghav@linux.dev, bvanassche@acm.org, dlemoal@kernel.org, Swarna Prabhu , stable@vger.kernel.org, Swarna Prabhu , Pankaj Raghav Subject: [PATCH 1/2] scsi: sd: fix write_same(16/10) to enable sector size > PAGE_SIZE Date: Tue, 10 Feb 2026 17:50:42 -0800 Message-Id: <20260211015043.2608866-2-sw.prabhu6@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260211015043.2608866-1-sw.prabhu6@gmail.com> References: <20260211015043.2608866-1-sw.prabhu6@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Swarna Prabhu The WRITE SAME(16) and WRITE SAME(10) scsi commands uses a page from a dedicated mempool('sd_page_pool') for its payload. This pool was initialized to allocate single pages, which was sufficient as long as the device sector size did not exceed the PAGE_SIZE. Given that block layer now supports block size upto 64K ie beyond PAGE_SIZE, initialize large page pool in 'sd_probe()' if a higher sector device is attached ensuring atomicity. Adapt 'sd_set_special_bvec()' to use large page pool when a higher sector size device is attached. With the above fix, enable sector sizes > PAGE_SIZE in scsi sd driver. Cc: stable@vger.kernel.org Signed-off-by: Swarna Prabhu Co-developed-by: Pankaj Raghav Signed-off-by: Pankaj Raghav --- drivers/scsi/sd.c | 79 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index f50b92e63201..0e0c5dd1c668 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -112,8 +112,11 @@ static void sd_shutdown(struct device *); static void scsi_disk_release(struct device *cdev); =20 static DEFINE_IDA(sd_index_ida); +static DEFINE_MUTEX(sd_mutex_lock); =20 static mempool_t *sd_page_pool; +static mempool_t *sd_large_page_pool; +static atomic_t sd_large_page_pool_users =3D ATOMIC_INIT(0); static struct lock_class_key sd_bio_compl_lkclass; =20 static const char *sd_cache_types[] =3D { @@ -922,14 +925,27 @@ static void sd_config_discard(struct scsi_disk *sdkp,= struct queue_limits *lim, (logical_block_size >> SECTOR_SHIFT); } =20 -static void *sd_set_special_bvec(struct request *rq, unsigned int data_len) +static void *sd_set_special_bvec(struct scsi_cmnd *cmd, unsigned int data_= len) { struct page *page; + struct request *rq =3D scsi_cmd_to_rq(cmd); + struct scsi_device *sdp =3D cmd->device; + unsigned sector_size =3D sdp->sector_size; + unsigned int nr_pages =3D DIV_ROUND_UP(sector_size, PAGE_SIZE); + int n =3D 0; =20 - page =3D mempool_alloc(sd_page_pool, GFP_ATOMIC); + if (sector_size > PAGE_SIZE) + page =3D mempool_alloc(sd_large_page_pool, GFP_ATOMIC); + else + page =3D mempool_alloc(sd_page_pool, GFP_ATOMIC); if (!page) return NULL; - clear_highpage(page); + + do { + clear_highpage(page + n); + n++; + } while (n < nr_pages); + bvec_set_page(&rq->special_vec, page, data_len, 0); rq->rq_flags |=3D RQF_SPECIAL_PAYLOAD; return bvec_virt(&rq->special_vec); @@ -945,7 +961,7 @@ static blk_status_t sd_setup_unmap_cmnd(struct scsi_cmn= d *cmd) unsigned int data_len =3D 24; char *buf; =20 - buf =3D sd_set_special_bvec(rq, data_len); + buf =3D sd_set_special_bvec(cmd, data_len); if (!buf) return BLK_STS_RESOURCE; =20 @@ -1034,7 +1050,7 @@ static blk_status_t sd_setup_write_same16_cmnd(struct= scsi_cmnd *cmd, u32 nr_blocks =3D sectors_to_logical(sdp, blk_rq_sectors(rq)); u32 data_len =3D sdp->sector_size; =20 - if (!sd_set_special_bvec(rq, data_len)) + if (!sd_set_special_bvec(cmd, data_len)) return BLK_STS_RESOURCE; =20 cmd->cmd_len =3D 16; @@ -1061,7 +1077,7 @@ static blk_status_t sd_setup_write_same10_cmnd(struct= scsi_cmnd *cmd, u32 nr_blocks =3D sectors_to_logical(sdp, blk_rq_sectors(rq)); u32 data_len =3D sdp->sector_size; =20 - if (!sd_set_special_bvec(rq, data_len)) + if (!sd_set_special_bvec(cmd, data_len)) return BLK_STS_RESOURCE; =20 cmd->cmd_len =3D 10; @@ -1507,9 +1523,15 @@ static blk_status_t sd_init_command(struct scsi_cmnd= *cmd) static void sd_uninit_command(struct scsi_cmnd *SCpnt) { struct request *rq =3D scsi_cmd_to_rq(SCpnt); + struct scsi_device *sdp =3D SCpnt->device; + unsigned sector_size =3D sdp->sector_size; =20 - if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) - mempool_free(rq->special_vec.bv_page, sd_page_pool); + if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) { + if (sector_size > PAGE_SIZE) + mempool_free(rq->special_vec.bv_page, sd_large_page_pool); + else + mempool_free(rq->special_vec.bv_page, sd_page_pool); + } } =20 static bool sd_need_revalidate(struct gendisk *disk, struct scsi_disk *sdk= p) @@ -2920,10 +2942,7 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queu= e_limits *lim, "assuming 512.\n"); } =20 - if (sector_size !=3D 512 && - sector_size !=3D 1024 && - sector_size !=3D 2048 && - sector_size !=3D 4096) { + if (blk_validate_block_size(sector_size)) { sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n", sector_size); /* @@ -4044,6 +4063,21 @@ static int sd_probe(struct device *dev) sdkp->max_medium_access_timeouts =3D SD_MAX_MEDIUM_TIMEOUTS; =20 sd_revalidate_disk(gd); + if (sdp->sector_size > PAGE_SIZE) { + mutex_lock(&sd_mutex_lock); + if (!sd_large_page_pool) { + sd_large_page_pool =3D mempool_create_page_pool( + SD_MEMPOOL_SIZE, get_order(BLK_MAX_BLOCK_SIZE)); + if (!sd_large_page_pool) { + printk(KERN_ERR "sd: can't create large page mempool\n"); + error =3D -ENOMEM; + mutex_unlock(&sd_mutex_lock); + goto out_free_index; + } + } + atomic_inc(&sd_large_page_pool_users); + mutex_unlock(&sd_mutex_lock); + } =20 if (sdp->removable) { gd->flags |=3D GENHD_FL_REMOVABLE; @@ -4061,6 +4095,14 @@ static int sd_probe(struct device *dev) if (error) { device_unregister(&sdkp->disk_dev); put_disk(gd); + if (sdp->sector_size > PAGE_SIZE) { + mutex_lock(&sd_mutex_lock); + if (atomic_dec_and_test(&sd_large_page_pool_users)) { + mempool_destroy(sd_large_page_pool); + sd_large_page_pool =3D NULL; + } + mutex_unlock(&sd_mutex_lock); + } goto out; } =20 @@ -4101,6 +4143,7 @@ static int sd_probe(struct device *dev) static int sd_remove(struct device *dev) { struct scsi_disk *sdkp =3D dev_get_drvdata(dev); + struct scsi_device *sdp =3D sdkp->device; =20 scsi_autopm_get_device(sdkp->device); =20 @@ -4110,6 +4153,16 @@ static int sd_remove(struct device *dev) sd_shutdown(dev); =20 put_disk(sdkp->disk); + + if (sdp->sector_size > PAGE_SIZE) { + mutex_lock(&sd_mutex_lock); + if (atomic_dec_and_test(&sd_large_page_pool_users)) { + mempool_destroy(sd_large_page_pool); + sd_large_page_pool =3D NULL; + } + mutex_unlock(&sd_mutex_lock); + } + return 0; } =20 @@ -4446,6 +4499,8 @@ static void __exit exit_sd(void) =20 scsi_unregister_driver(&sd_template.gendrv); mempool_destroy(sd_page_pool); + if (sd_large_page_pool) + mempool_destroy(sd_large_page_pool); =20 class_unregister(&sd_disk_class); =20 --=20 2.39.5 From nobody Wed Feb 11 16:26:17 2026 Received: from mail-yx1-f51.google.com (mail-yx1-f51.google.com [74.125.224.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A4FA2C15B5 for ; Wed, 11 Feb 2026 01:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770774706; cv=none; b=SBW4O6cGyFjdju12TckkFVfyE7NTyGZE6Lw+/NjjOF6p3dmytsZP/5SZ6O6RNng8rFSOwkMIv2rWwyYcBPC4CFUn1zLi9/KTf8mZL44oH8a9ij+XM0peNpAaj0dGIDfAoxx9OPE/9VGt8Fe9ggB81/P4x+mpend62nAQ3Lp2XrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770774706; c=relaxed/simple; bh=20+9y7YQsMaYpLIF1xi4kLOE4zsZSv0FqYAUVC9dCIo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WIPBzkUXY3CtNRXBHNXLKK8J4Dt8tuo3+TvDkEWB8xVdDf7Xu6oQGgBBiEGEQxYZa92IZU1gUQA9Rw22wDIFuBkbkZSnsXZfwryJkKIIDkZBhhRm9zvOjx/V0pvSHSe14zLSj+iKaVGJHwHEf8aqwfPDRQfOm2lbPlDzrP5/6k0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O6YMjUZj; arc=none smtp.client-ip=74.125.224.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O6YMjUZj" Received: by mail-yx1-f51.google.com with SMTP id 956f58d0204a3-649e456e8a2so1434556d50.0 for ; Tue, 10 Feb 2026 17:51:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770774704; x=1771379504; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EwRohyCczQP5APpYBp0ujf2bOM2ndalqngFoPQX4NTc=; b=O6YMjUZjBulL2QD9hcq1wZ2RPyQrCTjIhHQoumE9VwTDjbKisEwP2U6hhqevnavVRW qR3M+ZtwLMH6KoWxyWI3hdvCYViW8pzQ62qEkpEuxTDJ4tDczcb2YwiBOEvQm1BiG8pl 0jpQlJEXeYfOO336ewW0TXJGzv/ejZMYAxKhqsR3/ireIdyUDE0Ae7Mm4untvjwN57Wv vt9+arXyGWSt35zAaERDcckLhN6OSij3QwNoi/kDoCJuJ+XoCunyjCCIuNekobz11S5N g2uZYcGmtWrac/S77fB4tKKwC32v/Sv2ooowEKVP3jEdgqbAW3mLep+jyokVRFGZA8zG lfSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770774704; x=1771379504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EwRohyCczQP5APpYBp0ujf2bOM2ndalqngFoPQX4NTc=; b=grCuDH9VvAIda3t2LhgFvySjIP9gJWP4TkvXshAhHyuMHOqDLa0CH6tf9MmxTOuUlR 6tp8my6jOD04GB0UCW6l2nLdDq2cF0tbrXP6efdhxbd9b2JBNjvkQw7emfVbeY2kUElE 5WQb6dP6/7GxC/Jbp0G8b0SlXqVSYvQDPeJliZKXDboOZsnGY3UgLtMYAomcMc5g+l8J IikPvLCfrwHabRcdOmd8SceGj7CzdfLAIiwp+tgX9bjsnRB2tf2LevFnapgi3ruMuh4Q WSAcvQA1hy4m2h0flUxucSiDkGNyPuu5dKHOEjEe2gvSGWOYAPtceFH+7nwd7T8VTC79 J0dg== X-Gm-Message-State: AOJu0YzHhflztFkN9TrezuJDQPve1LX8s5AqCbppC1qHjSyFqORwoPQa 1xKujVaBJt37GtaTfS8KhnmAnn9DqzzlYvaOecNgqdPu9znfTyzPlgxJ X-Gm-Gg: AZuq6aLsIjtDeoYCdcmpS92z1PeVwbGIIJyMtU8c8pbBae0VfzDkcwLY8cHRi+xw+Uf 3ZH+2MFGSKuXmprRu70Pa2skZzuuFm5t7Tf+ZYa2Yh2rXwu7eQOod799vANgM6lfRViKcceYt93 H5EuYIbLPFsMzE8coIKRIfyMpnS/dSfpBHgasAPEgxlqt7o0pEmjCqk60XND/xqe+JEpHIqnUNp WuBe1jZ6WnJyiuOctLnT/hcDzLmma4CZirB55q2aquQVmAbQZ0HORHpa/UBmSj7Pmhx9dR3AmaC B7uTwtIWGwiuse9nYKafy6eB69O37+BozEA9duktQz0fAXojVSlVZhsKSOusGeYdah32Y3PP2Ae /Gv0t4BXumWYDg6beJ9WuLj+T72GEyzrURXNwoKqR45qbYgaIg9hhpLtRHbA57VrpLnsRWGhkOV 0BbIT6ykFN2E0y/1+sdcEUSVww5vLdd7ZZkIhTz8HI3ZEyi6I= X-Received: by 2002:a05:690c:46c7:b0:796:4ab9:f29b with SMTP id 00721157ae682-7964ab9f356mr151505747b3.39.1770774704462; Tue, 10 Feb 2026 17:51:44 -0800 (PST) Received: from 5163NRD-SPRABHU.ssi.samsung.com ([50.205.20.42]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7966c16e7c6sm3751557b3.1.2026.02.10.17.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 17:51:44 -0800 (PST) From: sw.prabhu6@gmail.com To: James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mcgrof@kernel.org, pankaj.raghav@linux.dev, bvanassche@acm.org, dlemoal@kernel.org, Swarna Prabhu Subject: [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE Date: Tue, 10 Feb 2026 17:50:43 -0800 Message-Id: <20260211015043.2608866-3-sw.prabhu6@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260211015043.2608866-1-sw.prabhu6@gmail.com> References: <20260211015043.2608866-1-sw.prabhu6@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Swarna Prabhu Now that block layer can support block size > PAGE_SIZE and the issue with WRITE_SAME(16) and WRITE_SAME(10) are fixed for sector sizes > PAGE_SIZE, enable sdebug_sector_size > PAGE_SIZE in scsi_debug. Signed-off-by: Swarna Prabhu --- drivers/scsi/scsi_debug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index c5085e6d2e75..91f42b7e68aa 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -8508,13 +8508,7 @@ static int __init scsi_debug_init(void) } else if (sdebug_ndelay > 0) sdebug_jdelay =3D JDELAY_OVERRIDDEN; =20 - switch (sdebug_sector_size) { - case 512: - case 1024: - case 2048: - case 4096: - break; - default: + if (blk_validate_block_size(sdebug_sector_size)) { pr_err("invalid sector_size %d\n", sdebug_sector_size); return -EINVAL; } --=20 2.39.5