From patchwork Mon Aug 5 11:33:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13753523 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CEB3155C93; Mon, 5 Aug 2024 11:33:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722857626; cv=fail; b=Y/DsRvYHPDAhAwm5touTRnqsa7CO+YAOxoqwbxZlgmsCJ+DsUkjeNaUtFgD6DYV/i+XeXh7jsGpIBZ7kirxf5MO8fJMCzFbii4P6d9/MMkx2XSxPYiEa1sI+lcd5tu2CxHNrPSz59Kkdw+aW+PeuL8/PTEtvVg4W3FVcGv/OBd0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722857626; c=relaxed/simple; bh=SmjA48cBWWlot5fjeV5M26kiQ5R/zGIk/sYfYmddS7A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=qPC2L+dCiyGZ+fpLS3nZNHeH8Fohum24zVQNGQWoGQ9gBKn3waAEZCmwJTPIKnKMFwxJZ3+bMdpDmE3Htlb4L15ALctRytJQ4TvdgG64xYzoMHQeJFhDSZl7yqfK6UtIA2ymAvQb25NaPKDrqzPsfEQkb9AMN4Jcy2WEuaMRT/M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=IZIdapLU; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=jwFfSkYb; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="IZIdapLU"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="jwFfSkYb" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4758fWuf028157; Mon, 5 Aug 2024 11:33:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=7YFOafPWDlLkq6ZA6FFHfSeEG2rL5BHnudcweGn65lU=; b= IZIdapLUf+lyOcsDjlGgjqT3dhR8rctJNXg0H+Vbm+81khz1aPdcubDhIHrEX2Wl C5bfPGHt4rctqui07OoUcOHxu3UW32+kbpYy+VG66q8J+KMtI2nkOXSuREveEAVA SibbSWc18w6fYwEOwHILLJ3Oei81ZuNCPQkE3OuqCFM9EDCsZrf+7P9ZofSHb8hE fp1pnk8T+WmR/VQKdfDbR1beGmfX3Sa/enElsi3C2VfNJC1gln2Wd5KpYVPs940G k8xmWI0UdQnz2FIyJLNWyyKSfgRk/DNM7Ce2WplshBrhoCjk3Is6gRn/HvRXMfLB /I/5sU7gNLUlJqXR1KDU3Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40sd3ujc9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 11:33:42 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 4759d96H017980; Mon, 5 Aug 2024 11:33:41 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40sb074ujd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 11:33:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qBLmgllUeWrSmneUwKRIBSdUSxSMCys6dlSYe07APiYc2F3vt19pWq9j8oBjBubCrKFivaJoCeZB7Rd1Rx+6SFKgr1MT3IPvHN2mLoHufQJij5yRy+VjNm5M1T5K24V9eIYsMg1pRRr61pSrsltBblH7RenYETILPxuonLJSKWLIdyQuysOhi9T9BpFh0eJYGBlgLecXKKdJUzyOwhUZYCaFfawccs5+451miqFO6x/9I4g9BqtXKRTFl/HcBl6UfClvr5LSDrVZHuw2AF3hiwHJbBYPQv3AtTX8lTPMKQnOGiWztKBGY/kyROwzFo3c+Q3MRC3DPpThsQxgsXMdCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7YFOafPWDlLkq6ZA6FFHfSeEG2rL5BHnudcweGn65lU=; b=xUtREewMtFTn3/lp2fVkXTg1CuIbr8w4oa517XfJ1jPoJopODNHBiElme2m5CCoTN1Am8JjQi8HvAAWPEjNSQiVWVuHIula97/EPgJmdA/VIey12bBUangnKfhqvQZbohiVZel9k84F5xX2sHWntSuFtYoqDg5pimQbas3N9ZodY3chMwVsloHWj6ij6QtFty+Cr6H8MZSybwtax99vaJ4sSqJb8uhfMEBc2IG4UiapM9Rv1JZvoeQPGqYNLrFVSACTup+/+9Ph86GfGFJ4jUnjtNEc/wHHRtLMeddxWDQswtXAp/u4ntFIn45sGJfTAVE+Awq31WHAOa1eutzfzjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7YFOafPWDlLkq6ZA6FFHfSeEG2rL5BHnudcweGn65lU=; b=jwFfSkYbgsKi3u+LM9qgtH+mjr294RsVnLDuE04dg+7KIhnHDofVy8H7ig3Hqu/ltncfw9nKzZIwCfz/n1v1N+s4Fmgwssoc3x7PxMjOGvllc7fgVzpZVoH3X1J2gsf1tkGXW5DXifdTocYQzZLmRJa/1pu8carOc9GXQf25o0k= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by CH2PR10MB4263.namprd10.prod.outlook.com (2603:10b6:610:a6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Mon, 5 Aug 2024 11:33:39 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%7]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 11:33:39 +0000 From: John Garry To: axboe@kernel.dk, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH 1/2] scsi: sd: Don't check if a write for REQ_ATOMIC Date: Mon, 5 Aug 2024 11:33:14 +0000 Message-Id: <20240805113315.1048591-2-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240805113315.1048591-1-john.g.garry@oracle.com> References: <20240805113315.1048591-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO2P265CA0159.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::27) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|CH2PR10MB4263:EE_ X-MS-Office365-Filtering-Correlation-Id: eb57644d-6b18-45a9-daf9-08dcb542737a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: Jn95Df64MIbBpoEVmQcTpd0F0eO5kgE8pM7Xe34SEKSkgT156qbdHugs9uqDHDErzqTOwO/FJOxmV77iFcBSVmWZ11K9tOiiOi5myZ6iov/56E4A3dG39hsY/N6bQrxnUuzXXLFGg2v7wAsLYX+u3/uIV/qSW8ywge8iOdBgb0sFmkUnJpUPp2XIFGM+SFTi9p+ywwQhUPY/qSeKKbnUXT/Jlj8595hNlBXv+AaTvwEyo/0SQKloV2lM84slEBhV/k00E/XCoOKWwcNMEDyMOFhFtyk7kcqVWsF1j6aNfK8dkrT9MuiANntP5auWqhAXB5TjtASANeUyZk5h/EwC5Lv6gexJSiJ0dmAP1Co+Y4XhdyrGjwsWosee/SGmgXAaETs1vDpc8ybcJMaSQGhJ4bL2LVCv2Z0hboIZbmcBIH5iVKZG4/7S0KoedYoHcq5cvTkvpyTl7GaeftLRgaLQjD3fBYbRD1AbJBlGoX+pQVE3dYnCII7IyTiF1a7UTnSeEzWnax99HiuP0hdnJpH7RbymlKcDxjDRYSdAUqyZAudg19o7USUbVb55CL3LA/DV3WKVhBkmFRpfd++4UhTj7jjm33PQkk3Rrl5YMaO8KZzt07Wd1FIqXhHABIiy/bWcQqyeBfkHPW3T81LQggCnVqGi1PnG0vK6fKszsPZjzs5x2wfnwulg5ygH99YJ9l+jYMJgXylZySw9RnBsSudjcZGrtTC7pmKiVi9XjEIEArc83zE8kb30RqNuXrdSem2BBHeIaZBb6G51Y0pX067C+6373Lx2neeFBJw43zm/nh/bHIxk3mAf623VHSSKdehpA0kegpF4jnn75IcnUqQgDe62+DIosWwrfnP2/DT4mBVQk7sddmoQdakfN3yWJH39mIgrrF0/P8fWGHzAJNf6N6rjBjY6UBdD30fxjgbSUyW35vbqi4Kn1dHUPJ93bgsEXa9yKgfnAE8zYY3XdDWanC4AQaIMB3gGXIlyr5DHSHLDlGqhN/xVLXpkCDFg1HthObKimhbEiggwgaE6NK5hJfiWcBrf8Q8amH5Y5dY2ZObBZfeQ1HidZcXoIBhgCWYLrOJ8M4RxywiVXmF+rKVK3wWPh18FCpiXdevgAaJjkKC9Eh2E6B3uq+ahsdVWip6NWLGcAIrIPPcykRcFcF5QdfXhqMImrk3Z0Qh2lZdqGnYMS4eH/LGWp4OCWzRrg4s9xjKzzxT0dyotdaoshMsCdeUOMSgJlLIgMCXtyficiLtLO5ZQ2aFS97yObWAsdmBn12B3zFuP/21BplmPwqubvmGPo2QTg+p/EBsM19jRMlMQkroSlsXc+284JwOZVBPAbHguAsFhjIyAPTfzYAKRDA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Chunk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iF8TFLVVg96Hpg3GIkv2iV4fKQSkK3DJ8XehAvOCYBnGsxTA4sz8RVBY0PFLM48XyvYpU+Jd/NhSMwb86BJhv8CabSnx5WHIwsw9s+wnzbUNFzVFam/7oXn+ypm35+eFG2Bm6GeuQsPpxduZZI2s0um0fmjwEmuiZSXBk5gFTLFUtfragMiV3uMfdfMpvb4Uc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb57644d-6b18-45a9-daf9-08dcb542737a X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 11:33:39.0798 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nxrzNJhraMwx/BVeHjtrBmJc6F8k9dz5Icxo/uhEFT3Uv6r6WJmnl546WTmiJck40TCcNLT3zgQiXd/7GXK0cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4263 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408050083 X-Proofpoint-ORIG-GUID: XHD2JxFRSv5IKGM35I0P8rE_WTYzuFMc X-Proofpoint-GUID: XHD2JxFRSv5IKGM35I0P8rE_WTYzuFMc Flag REQ_ATOMIC can only be set for writes, so don't check if the operation is also a write in sd_setup_read_write_cmnd(). Fixes: bf4ae8f2e640 ("scsi: sd: Atomic write support") Signed-off-by: John Garry Reviewed-by: Kanchan Joshi --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8bb3a3611851..2ab47fb50c75 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1382,7 +1382,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) { ret = sd_setup_rw32_cmnd(cmd, write, lba, nr_blocks, protect | fua, dld); - } else if (rq->cmd_flags & REQ_ATOMIC && write) { + } else if (rq->cmd_flags & REQ_ATOMIC) { ret = sd_setup_atomic_cmnd(cmd, lba, nr_blocks, sdkp->use_atomic_write_boundary, protect | fua); From patchwork Mon Aug 5 11:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13753524 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C77A615698D; Mon, 5 Aug 2024 11:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722857630; cv=fail; b=cQhj/3PIr7jxx32CHuCbHit1AFMOeSv8X1a8zyNTz/O5rVbjDnrGJQ2z1Qkuh2V7gLk54fdsUPclzI3mUf4trvMBfD/2wWPE4fFftzoIHka9Tj46bgZ5ukuvzW4Sp/yoxW89n2BGi+w8BShpSaMu7KDjNplbTGdbZb8InVdFF0c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722857630; c=relaxed/simple; bh=ProXs+x/EmoBoSYV9+91rLQFSUBchAfPU37S6gCXHBs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NlsbdQR/+DFFsd+NKwh6be9+slLGiryTzztN1c7UHOo0+dom5/0ANFpLepxZRH/W4Knboz4VYRaESdktJr77j3aCVie9oJZJC17WGUonFChi2wovN+bxvYP1Dwj4T4+QCAKkHrJqmGJGqbQ6U2obAUSC6dqbCmhnw5p92MSytlQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=iG9TT4SK; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=LhyTZQID; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="iG9TT4SK"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="LhyTZQID" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4758fYB2026939; Mon, 5 Aug 2024 11:33:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=L3ewAtTPzXvT+RhfPxFOjTloynAmwHF5OoqsWyKSikw=; b= iG9TT4SKV32El7iAS8rez9hDRR7eFfraOr/FW3LUCvO7zAvvuUrAVgauoklN0tTz 4rvZTsmWxLPU/UfTdLh3uwv6D3dnBJxSnx9jnH+DzWrkmoROqxvLjF8ASipFJYIY XDgyOmVio1rIbJRDH9BQuvj938+xw4m+XGGjx6ROnEge8CcjvEgWwZhmN8lnd6GD uCGcXQLx4kZQ/Jjs44+CXN4qIwlTfwXfPcEX59QLMYECyRhv+mxgJhsItUqlhVgv yGW5jEBgMEml4XJNCp++Td8mQmqG4nKZTen7muCrdbuj/PcH/7jX+Z8mCC+JOnfh 5/KUf3jWqPb0ilItZj6JZQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40sb51aee8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 11:33:46 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 4759vHoo027322; Mon, 5 Aug 2024 11:33:45 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 40sb0ddch8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2024 11:33:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bnY70qDvk2GZb9YF2rHPrAFT/Is2G2v2ZMP+U8jeEej7Q5mcuD9Gf/BXhx4hW3nFQ97hYaQEIF8PT6sOSeKKaBOzyS5DhazR4hjGK4netVDBSJjRX2dxrA/K/lzNiSvAZ3WQNrIlDlTtKvb3tBt98tKxVIgksJH2fcC3ga5hZV3CQQqQ9B8uPslgie2DHkDWcw4HUyI0hqt0qkn6YDXlayDiuWM0aQsUN7lC1c77Qnie6XLiKBQhh9jSxucVpT+9Wr8Plc1cCFNvKM5frznyc7lyEeZ70xQkXdEeNah8Y9F3qz5yHbaP/P0Brb68eDaw8+vP4ZfvGU5acoGN9CQ82w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L3ewAtTPzXvT+RhfPxFOjTloynAmwHF5OoqsWyKSikw=; b=GGVjsvBknI4dLZQsIptMA2zPbTChNb8ESvIimfjCAwjFgmJ82AFuGvYE8v97l0q7wezhQD3wGs37ztHyMzVhRw5kH8wc1KaAA2bORS0VNZWlqD7RRzJzLXz1lhTzckOYn3+CjnAezE1ynTcSPwAm8y4yrq8SbUd/UbOHz74SBBPzlgmnZi3b3U2Gek19toP6vjn28Fnnj2TwWgq4ZNx7Q42ynTRA1IZD8k149yhMdZ+oUD0dCKbAua6/yaT+osvfShuu6trk9KW5vAjdhgoZZ3IXxLyoSW9SQ/oFH7DUTwS2bSxc9/+4+pDKLivuuwQN87SGlNm0/lUIVWXSPM1gIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L3ewAtTPzXvT+RhfPxFOjTloynAmwHF5OoqsWyKSikw=; b=LhyTZQIDBvGINjj+BRfxf2c0UGIKMfuOXQTWJB4lr1KrJX7WGk+OsARepBiD2Nh4LuJH/aH7l1BSCGHOTWpWFtHrk3W6J9O+pEuz4Ld9pBEgBMSa7//TUvajlP4MOkktg9i70+R6jOY/V+59u+lvYajZI277+mjyNpjqcMoPYTI= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by CH2PR10MB4263.namprd10.prod.outlook.com (2603:10b6:610:a6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Mon, 5 Aug 2024 11:33:42 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%7]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 11:33:42 +0000 From: John Garry To: axboe@kernel.dk, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH 2/2] block: Don't check REQ_ATOMIC for reads Date: Mon, 5 Aug 2024 11:33:15 +0000 Message-Id: <20240805113315.1048591-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240805113315.1048591-1-john.g.garry@oracle.com> References: <20240805113315.1048591-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO4P265CA0089.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bc::6) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|CH2PR10MB4263:EE_ X-MS-Office365-Filtering-Correlation-Id: ff79ae1e-a045-4191-8bf4-08dcb5427552 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microso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Mp4HnZ7YVgJi7Z30kP+e8b3eTo9zPcWMpO6hVFYWWftAruIvuQbon5d1MPDIKSbJWzICuPWdrZRKXZlLTgZ0KxDfd/2+A0aicJxu9oLpd00n/nvQMnSQ/qpa0m8w+Os93j/SrBb6ogDL6rjSQL5ZI96E17Jk/pmPW04lcq0HIUbADFmFdPGRs04+r4LiqY1+djI0QDeitx883qB7dETFuCJ0XqlgX5NRq3JE/r/+cPz9IcAz1i5AHwykLmYOZ/ovehuBxd1ohDS5ODZ8Ma84sJGObMTc0YNB683GOc/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EXAcBH2cUIO/7N14Vj4zEOOkJph+3mn1UpRxuW1hv5XKEN3N9Yr1ToWHHSwwf74AwBA/6A/xO3b5ZlLtEet8co5qZByfxHxX/cbihOZ8zjrdzWztoW8bsyoHxEtaKKWSZ458WQpLX99CZlY7Vny0RN9VoqJSQ3UlmeVmQnx/fhAyU0OSvv9T0Ie9VcaX0Xy8OOsSKOrDJrbg5UAka2x8sxhMEkInQA/8R8DICj9RcxvWv1LzDzrs/PcK1IkYv/ubj6TG4/pF7zflDlQP4qJoVIH7RC8SfAz0NuvaMq3L81bs42otWWsvukm9SRbT5ThcMB/ST2GCabgIcyky7fIVM5TyYcy6SKtHZc+9Yi1Gakew41IqLmG/CgMk2zQHsPX/Wu9FwmNe6j7t4A5Gvc+izdHx1I1H11sC314YnwEnTjPqkc81p88I+e+lhl/c3gtBwWRYTFlTI+H99zf5KA/c/EE/2JGLBejgyn3Bzb/tFXLq8PENi74PXN2pxFmoZX8t9o1vdMmv4zAj7BG6AopMhzqlM6fFQH8DMM6lFSRK52aRy7Mkj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ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JCfTIbpa2/EHREGtV90oB/yjT76vhY/4yn/XFjYRwh9erK2IaT6plztqIt+i2ZrS0qDLyfvmoH8KZnzL7A4/+wjL5D1IVjGbKXOc1BJWzrE4ELBb2sE0izrR3S7pDLel+b1MGP9MwGFlwVne+KEd3iFAnIam+1fYvNwVXtvgSv7KJsT3F9Wu7gWXsDDZ3WQ0tBS+W+8Ynjd5h+EZC+ucEdJHNcA+diuU794BOJ528kvEiP/gu3qrykdCH2MjDm76I0TmolI6G60WrDJ+TKbfPgO85VuCibA8NYMQ37Do8DVA8UySbOgsxvCujwzSfW07IG4h4b/0+g8XGkSGprdeaODeSr1x/+asQ8QI7oOlWo3PgbAXjLt8sIzf9V86PpUjXkfloP4xYfHfUW95zPuytGYX+MUUOx6nngFFVmi5v/IWNnwB5KO75KOyWKQtBeFBPvNbz1vMSPPfrz5oygdlLDQZoMtqxw25htEpICcszCu9pFyoo/SyGIhak3Fcf+gq35fJ7QE4ym/dBad+xuJxRU2rqdpi+ZmWKMEGx07fZqkxD+xGrl1pcHTzsh8zC2ckfOgagpE3Kt38OxSzUebeApuC5tL+kkBchvXrBHm+WVM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff79ae1e-a045-4191-8bf4-08dcb5427552 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 11:33:42.1445 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OAU2ssHMBAwYpJ0X5GtFE64zvJAsRCqccL2u27JtZZouL3zDclRiAJED8/Qjcum/7KoZeKA1GVgi6M2gLfaKfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4263 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408050083 X-Proofpoint-ORIG-GUID: -63jvwXBGDKLKpLBJgGF7x1NrdPyGRxj X-Proofpoint-GUID: -63jvwXBGDKLKpLBJgGF7x1NrdPyGRxj We check in submit_bio_noacct() if flag REQ_ATOMIC is set for both read and write operations, and then validate the atomic operation if set. Flag REQ_ATOMIC can only be set for writes, so don't bother checking for reads. Fixes: 9da3d1e912f3 ("block: Add core atomic write support") Signed-off-by: John Garry Reviewed-by: Kanchan Joshi --- block/blk-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-core.c b/block/blk-core.c index 1217c2cd66dd..bc5e8c5eaac9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -799,6 +799,7 @@ void submit_bio_noacct(struct bio *bio) switch (bio_op(bio)) { case REQ_OP_READ: + break; case REQ_OP_WRITE: if (bio->bi_opf & REQ_ATOMIC) { status = blk_validate_atomic_write_op_size(q, bio);