From nobody Thu Apr 2 15:41:46 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 358BD148850 for ; Thu, 19 Feb 2026 04:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771475980; cv=none; b=eOLOlY6jRmMKr67EMmk3xjHg3pQPCq2xrL6XxEmofvxNVdQ5mLRdN1YuegGNWH9Tb9EkrVpjso9c6pqNsNOGoavICDgJ9ewnQ2lzQ5GKmIHamDvLO/j2OUQLUDv1NLwXC0AVxy5q62VBabTIovmpLu45m+SeeAtSR1Mj72PC93M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771475980; c=relaxed/simple; bh=/+hxZZTRXC2qWipiE54XkooIeb/8eA4K6wnLScBQbQI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CmZWds1Ys44NZXrFBBlUbmoEPLcxYbJdoyr50Hv7i5hDAaTnZalKHuzF1Gg7rIpIdnGlirp6wtvtUGJcZqURTwC/HCMO3E83lL2k6Q5WsV2ZQDawwNpfIGCY4TX7J5OkxO6JCVq/ggwODfCXDHa0nxEwYoYYab7sjqOMjGfTtew= 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=Bn6mg0CI; arc=none smtp.client-ip=209.85.214.176 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="Bn6mg0CI" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2aaf5d53eaaso3131355ad.0 for ; Wed, 18 Feb 2026 20:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771475978; x=1772080778; 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=46IFIdbZ1G8VUr2RBCZqSJUa4eIUYoNzWfYcnZxpWws=; b=Bn6mg0CIOiSt7LVhehiqm1Qr8fImugXCkxSSjWcJgvZT49amemmMpzW3gjLMBBJEYM gIAU+nO8ZV2ZAtAT1kzIGxqX6/idzlzWTCJM3hRceALgS55ko9Xf2eH2RFkN4gxwYwcw SAzScdzzYF+F1xol7b8EUcmlNpVOClChnICewWEIdytbbTm9n9yqx8FnQyoyyFlaA7Tb XJWPudQFfobvDzDmk2O4yWvo0gNr5aJNcYeRlgBT8XgCOrLNBJipFpGs0Oyntogti1BF gshVf8oHqBFfY9Yq2/3o++Wd+K9G9Z5CgukhnSqIZpDiy2QnDoZLHIMVC3mSLgJNkS1d QBfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771475978; x=1772080778; 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=46IFIdbZ1G8VUr2RBCZqSJUa4eIUYoNzWfYcnZxpWws=; b=A6BUscal49VaUYmYvtzRcqT1ArKVMD+C0tRcpmCmHjll0vh3rf4nUlIefo/Hl+B2/6 SeXRPLpBtsmdYF1P6F7D7W7p6sicGWd2XTLVbPidRZbFmOrY5ZoATrt7dtIAXuU2+u+G mhHa79C3HOJbNXIBO4otz+0FI4AdXus8x9GFL3JTlabqbt64f8Z6cyqtKz0l6/RLj6CV Ai2Xo1x7usdfc9JBkF48PbZWuTqk3uIP8E52UXO10AJyqNr79cz169VfEKvNwvmb16Jb rPFdo7Tl7KlHo/CCgdQ4Kdi9EVk6Ard6VGUlw6Z9z9lmRhFsVHpAtljWGHWwey23kb51 ynmg== X-Gm-Message-State: AOJu0YxvkUJ0udln7t7aDNSjjxZ2OcrkWLAdfPjLGefNvQ2mMO+yDgqr Nq14dfkzRaiOs7rQECKMVz7cd9xEzf2/HZ8lYY5hlvOrhv49OlISGI/4 X-Gm-Gg: AZuq6aJ+gcqv/7vkcqt2a9IOfKABbaROnyvoSEvyRNmhK8lY9eLVdfmZGuRKDTlLLcK k85qGWqV21v2GCmSfUjVyDDf1uwll+seFU+Pq0LyqOF4bF9jEx0W1Z5xlvz+juayPuvEhZyIf1p 86uq5H79tcTsncBCSkzkp2XKFoXRKDQXVBQ3b0MMflprZbRzI3Sfo/Y1Ssg5lQL2D/UkQRX+Xfc e1ju48qkaFkjfzup1kjDNQl3p9FtgSk95b+dafNosY2wlzzQTEkVutet2MijGhhSOsPlurQj2U7 +4LrUQbjKfPOE2m3A8qNF4F0GFrjPdpgTHiw0cYMJoZEtmeY+txxkCR2/nMT5ubgMs0I79wW/Wx hCUR0z6UwYasOc6Xfbhuy+o4s3NMY3PFwSzgbsxHdNwM/d6xiiOp/e6qXMFT2Y1JXuXkz6ZOSSP +uRdGhliHyYM5W19s4mywQh9EgmWYeXBRzm407vIgUAKCTaEk= X-Received: by 2002:a17:903:8cc:b0:2a0:9d16:5fb4 with SMTP id d9443c01a7336-2ad174441b9mr157343435ad.18.1771475978488; Wed, 18 Feb 2026 20:39:38 -0800 (PST) Received: from 5163NRD-SPRABHU.ssi.samsung.com ([103.50.21.94]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad1a713675sm203345025ad.27.2026.02.18.20.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 20:39:38 -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 , Swarna Prabhu , Pankaj Raghav Subject: [PATCH 1/2] scsi: sd: enable sector size > PAGE_SIZE in scsi sd driver Date: Wed, 18 Feb 2026 20:37:42 -0800 Message-Id: <20260219043741.276729-2-sw.prabhu6@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260219043741.276729-1-sw.prabhu6@gmail.com> References: <20260219043741.276729-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. Hence enable sector sizes > PAGE_SIZE in scsi sd driver. Reviewed-by: Damien Le Moal Signed-off-by: Swarna Prabhu Co-developed-by: Pankaj Raghav Signed-off-by: Pankaj Raghav --- drivers/scsi/sd.c | 80 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d76996d6cbc9..ce09239c18cb 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -107,8 +107,11 @@ static void sd_config_write_same(struct scsi_disk *sdk= p, static void sd_revalidate_disk(struct gendisk *); =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 { @@ -116,6 +119,33 @@ static const char *sd_cache_types[] =3D { "write back, no read (daft)" }; =20 +static int sd_large_pool_create(void) +{ + 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"); + mutex_unlock(&sd_mutex_lock); + return -ENOMEM; + } + } + atomic_inc(&sd_large_page_pool_users); + mutex_unlock(&sd_mutex_lock); + return 0; +} + +static void sd_large_pool_destroy(void) +{ + 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); +} + static void sd_disable_discard(struct scsi_disk *sdkp) { sdkp->provisioning_mode =3D SD_LBP_DISABLE; @@ -928,14 +958,24 @@ static unsigned char sd_setup_protect_cmnd(struct scs= i_cmnd *scmd, return protect; } =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; =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); + + for (n =3D 0; n < nr_pages; n++) + clear_highpage(page + n); bvec_set_page(&rq->special_vec, page, data_len, 0); rq->rq_flags |=3D RQF_SPECIAL_PAYLOAD; return bvec_virt(&rq->special_vec); @@ -951,7 +991,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 @@ -1040,7 +1080,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; @@ -1067,7 +1107,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; @@ -1513,9 +1553,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) @@ -2912,10 +2958,7 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queu= e_limits *lim, "Sector size 0 reported, 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); /* @@ -4043,6 +4086,12 @@ static int sd_probe(struct scsi_device *sdp) sdkp->max_medium_access_timeouts =3D SD_MAX_MEDIUM_TIMEOUTS; =20 sd_revalidate_disk(gd); + if (sdp->sector_size > PAGE_SIZE) { + if (sd_large_pool_create()) { + error =3D -ENOMEM; + goto out_free_index; + } + } =20 if (sdp->removable) { gd->flags |=3D GENHD_FL_REMOVABLE; @@ -4060,6 +4109,8 @@ static int sd_probe(struct scsi_device *sdp) if (error) { device_unregister(&sdkp->disk_dev); put_disk(gd); + if (sdp->sector_size > PAGE_SIZE) + sd_large_pool_destroy(); goto out; } =20 @@ -4212,6 +4263,9 @@ static void sd_remove(struct scsi_device *sdp) sd_shutdown(sdp); =20 put_disk(sdkp->disk); + + if (sdp->sector_size > PAGE_SIZE) + sd_large_pool_destroy(); } =20 static inline bool sd_do_start_stop(struct scsi_device *sdev, bool runtime) @@ -4435,6 +4489,8 @@ static void __exit exit_sd(void) =20 scsi_unregister_driver(&sd_template); 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 Thu Apr 2 15:41:46 2026 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 CAC952857EE for ; Thu, 19 Feb 2026 04:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771475990; cv=none; b=kpblyqBNcz5QJvfeb9+COkDiXCwzhuY2h0N9a/LYZmUiLbG9ogM7R2TGA8rfBqoSJrJthOLqigKBDOh9++6iR0uMVCtlTH3BLnCB5bUTl80QAj6IJ18O8zkmwW8PbDYOO3Dbx44d1U+VUlJaZQr1fxHgE8h7iU01dQKypp9rOAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771475990; c=relaxed/simple; bh=ObbPzKcMkLFZEOmtX0HBbcQLzdXfZGKOceMbh+nh1/k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Xo6nbLw9MElPxmkLGSeH5bu3eGBM323kBUHIia1X1EkTlvIepiM1hQKscpjxCNiPhtj3HJ+g0xyboJCBFkCveTTTOCyXZiNBf98EcsguSmyGF4n8rFL/xA/Ahz28HDEc8jtSeIgNAXNxLkdkQUl/5UWZRoEFq/XS2UpH8Cb9FTI= 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=UAeSg0Qy; arc=none smtp.client-ip=209.85.215.179 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="UAeSg0Qy" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-c6e77ace76aso256606a12.3 for ; Wed, 18 Feb 2026 20:39:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771475989; x=1772080789; 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=TK2FSfFpgWRmabgfvqWtVYcxZdfMtKtMSre/uFQr/xo=; b=UAeSg0QyrGANPr9XQMKl92PwbhUuuTjli5GzG0K9m+FZ1JNyINSf7I+tavnr5iSYAD FXhORsL2XX3uGGs7PtIFM3VFL9nZUxpe1nmkn39piEblidKe3KkI9ZKoMisAUQIrTsa2 aRh3u3GDdm8LP3zq1aejQBZADPxDdJoPitSv0vSpFujC5MYkseamLE3VmdAF/5ogesEX JaHeOBGpDWTsW23+lya4f9c2ZCDw6yY4zzy1po80Ag2xU0fpVWCT7o9xHLm+7toduzrY yBp6X9h2oLn9A6ZbM8sMGo15qjYYGBNsqs0hAgAcLF9nILwuPVX0/540SoVJDr1d9RhX BC8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771475989; x=1772080789; 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=TK2FSfFpgWRmabgfvqWtVYcxZdfMtKtMSre/uFQr/xo=; b=YwPBu9uiz6BKiiSOB6jfcnRSft2dSYcxnbJJ0rH2FwhCk1SLmhYoBeM9qh4N1radRk dL44z7S0iEmS8c1B9auAPbdIa5FT3zzC6ZjlGFC9OsPaCtH7ckT0k7muhbpr6Vu96FOE s3lCM/WeUP0Id6mfkF/NN2b+dMppFBFU26uCeSW9Qtyej8GN3DgIQmJ6+g7Wb3rnLs6c 2ruuIgw2a7JnvbY/n/smGtEse7joAwLSnq7mnijE1i4CxGhhTG6JzDzAIdleTWx5KNbZ Dn7MwPDbPlpwPvuS3UW0KEnkdtx3FQeMVOHtMz8X3AZGbcXz1R9Cb/Rtq1XqfvoC3w2N 31Pw== X-Gm-Message-State: AOJu0YwvrWkqCuQcCaRCqNMcZwBDda8Ab+7U5hD8Mce11G8QYD58G0MA EPZjrEStmuML/thBpcXNeysx/7SxXaVZEtjrmIW3Zxh7UFPFUQZS/ls6 X-Gm-Gg: AZuq6aKAJVpRTIF7hoZLn0zhdIa/6+Paytbu0UdPd7xNKfMkb4VpNIWkFTmuizRXwHq MRZ34/ExsfLXApYRf9pqnTWw5+yXDcm7/GoJMCbIT2SC+Jz8IOoJwgv3dRylEL2g8ra4x2Y0wYO dYu/RTVPeJVcQ8ZebJ+AIGAPKqlGQANvzqTnDRx8KxcNMSUUwvvFkwsZOUD8jbWZ2aVMxTOOyVF OsBkGKNPwmT9K5ImK9hjyvMsp1yyFNRexuPuPkg61bk4nXGY/0LRl5EbuWd6eOiiDdvg9kW5U9Q hlmeY2uwJaJ3deWZ/NgCbofoMxMHcqsUscsUIJ3CuTIckm413mGzBJ2h/VYChOQaXfoNAVdTcNm VdUa1aRT1m7HxgsCLVKa+fE+uSo1ZM+6bgQYZtLyO1shJq8yFhWsvuYio7IXEJLB5TWM5xV2eBW nq2WI8I/6FpY7qOatvWZ4eVYFrf3AOJIyXyHs4wkk7cF8oSK8= X-Received: by 2002:a17:903:2b0d:b0:2aa:d7a7:8091 with SMTP id d9443c01a7336-2ad5aed3fcemr13876565ad.12.1771475989047; Wed, 18 Feb 2026 20:39:49 -0800 (PST) Received: from 5163NRD-SPRABHU.ssi.samsung.com ([103.50.21.94]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad1a713675sm203345025ad.27.2026.02.18.20.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 20:39:48 -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: Wed, 18 Feb 2026 20:37:43 -0800 Message-Id: <20260219043741.276729-3-sw.prabhu6@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260219043741.276729-1-sw.prabhu6@gmail.com> References: <20260219043741.276729-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. Reviewed-by: Damien Le Moal 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 c947655db518..4c6feee87f05 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -8495,13 +8495,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