From patchwork Fri Oct 4 09:22:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13821938 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 0E7F014BF8A; Fri, 4 Oct 2024 09:23:57 +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=1728033839; cv=fail; b=jo1lQNjQ2TTgQRST2Fg6d+eEjPeMQmHFuYr+CXGOUJERMSXHUrTTDMFJ7ji7egZaRSZl1QAWFH0WX9Pqnb4TaMOBudEDw4Q3Mdln9yrShA0kCzWo4CpBg1XEFkAL4kfu//Hfnd51FjjOke4hX4OyFbofVKtFNpuJ9vON6k/ksEM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728033839; c=relaxed/simple; bh=lxd4N7eR28r3sbPqxxker7d0yndncwA0/HmE226Da7Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ACZq5SWTJfecn6wDVV/wd9bhu5W8Q0u38xnchoi3INllk0HFNUuKxZocl4ZcFcLFJTWPqE40UECdWPBIMyM4vJQ12Bz39NJ+T0X4/oMnMLcl/oD48UY9/AvsPbH6olfE8JBuaKPEgIKdDsQjB3Z9LPAhwvIx/NLrj92q+pxtOZg= 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=OEkDTVxZ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=BhxOzOu+; 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="OEkDTVxZ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="BhxOzOu+" 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 4947tev0013498; Fri, 4 Oct 2024 09:23:43 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=STxOqbCDp/AAc3DmRB7xsYyTvFZ4NcYVVjPDSnzoTcs=; b= OEkDTVxZp1/hgFS8qpptzWZTRmhBng42mevj55n869sVDKfV0/qhtwU+cKSV/Zf5 C8vPZIT2PugdsKlUnGZiF8BTD7+d11/+Tkn6f/RXGrBed4oFP8wAc0nBrno4q0CL DMMVgQGSZUkQ9JtrTxRV5ATtLG9PBuhGGu5OyGhA7RXqLZ0ITgyGYQvmOUnBJOJ2 2kPVp/FqCs98TiBfm04Y/ACUbzKca7NadJBDMUXzmua8HjR1LY0lTHD57r4j07di /sMPP6eYlpW8L169mWQ8jmuCoZ4C5bl7ciDx0Ek5Yhc+fHPBmBHORQ2QspNjYxvM 2Ia/mCG0wn3Rpwvl2LegPQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42204es6pq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Oct 2024 09:23:42 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49495IE7038110; Fri, 4 Oct 2024 09:23:42 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 422057118t-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Oct 2024 09:23:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qw1WCL+nYeHb0bVGkY8t3atGL8cN+N7jvPxR3BFmPoSlVlCzsrHG3oL5s0euy1+XpTaqfve87QKA7GyBkK8Av+FfL0TkaYzl3ER+xbOzI2WMuMJjln38oxE2c3bROnrLjsM5j2ZnYsPkLOKjLUuptZUvTPloJTBbLQkuMj1p043j7heFZcyEpab155MTiOg3qu3kwHb/IOEB5Ii77X3XNGy0h3BkH9lJ6JClYEYx5ehU3jRKmjdaCugw2JZ06ZRzmFCVMEn+Trhtp3KM4DYsJO+7pYqmm4e26gizECo8Vliu7wgUZQTGygtuQVLoc4JTIeioDvYvs16/eF6SIwNHtg== 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=STxOqbCDp/AAc3DmRB7xsYyTvFZ4NcYVVjPDSnzoTcs=; b=G3ZGNqFatcMKHxnvTfWFL/OP1mDr1Tn0ODSfnA/HeaZjDpJsnOHshLMvYsqbFFE6IfM47xS5XXgIO10YNh8j7VBWYM8C+DjUqTh4o68x4sfly1CvLGvu8PCJgotKp/5t1gymPyo7hdf9r+TRAvEdvjy4bFg8RYy7Wo85zsbI/iUizfGVyqbkZZ+6XFlPXemsasYrbQbjUs0PU19AfYr55+SFTZbZSpBlCCisdTarv2SL8p3InSGKdDZLvImHy4q37Kdj/NQZbBLFo1P9jaxlSEJU4j87GoNfYl9UmTdRVizs4CHbcwLd0FesNK65+ic+X/qiJ5lcBGLMjPR1PQZUTA== 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=STxOqbCDp/AAc3DmRB7xsYyTvFZ4NcYVVjPDSnzoTcs=; b=BhxOzOu+JJpTR89Puv6V9yWTtKUUwtCP2msEMW0yVd4zFU/Lnc8Fmcn9pn6ngMp9L/bL6LdaDN95ruOjDryl7cV78xpii1YMT3iTNiRcvjJM2pjh09s7L3YbJ3+DMKJ+Gf8V81bGdoCJXJgc13ChFezcBGOCgz9c9Dv/2p3NUL8= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by IA1PR10MB6900.namprd10.prod.outlook.com (2603:10b6:208:420::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Fri, 4 Oct 2024 09:23:29 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%3]) with mapi id 15.20.8026.016; Fri, 4 Oct 2024 09:23:29 +0000 From: John Garry To: axboe@kernel.dk, brauner@kernel.org, djwong@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, dchinner@redhat.com, hch@lst.de, cem@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, hare@suse.de, martin.petersen@oracle.com, catherine.hoang@oracle.com, mcgrof@kernel.org, ritesh.list@gmail.com, ojaswin@linux.ibm.com, John Garry Subject: [PATCH v7 6/8] xfs: Support atomic write for statx Date: Fri, 4 Oct 2024 09:22:52 +0000 Message-Id: <20241004092254.3759210-7-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241004092254.3759210-1-john.g.garry@oracle.com> References: <20241004092254.3759210-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO4P123CA0165.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::8) 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_|IA1PR10MB6900:EE_ X-MS-Office365-Filtering-Correlation-Id: 132148f4-8a75-4b4d-00cb-08dce4563519 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: VsEM55BHyU2vndK/nW+oO5t2jvD8D93m4waWNp55nUk1dAG6uG+Tb0pmsu9ccLIgKRC8TrzWdv4MrV5vsMJn3N1mh3XvkD6SOcELazu83JGFIJH/Qli1oJCRpbUgmTtpI0SVPgYwbglOskvDMxMq1wNzjRoABOdq+m7r/xdhXhlsJ9vb5mx9bvjN6mbxRA/XtHptIBPb3eYXiKs585VcSl+5MY1S15qDqBIk1Ij2HARwv79ucBe3Non2ykB4MRKYYsOjsj68snOJqTynefs7A+RSx02fOsNIgNuNLx6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;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fJm/aKRg2eRYAk6o2MonJdYG/QGx5scvm6yttoDS7zGszf7337UKdjHjw8wFD0VYtCBxXz5ul0Bx6UVbHujevW2cTQ/SFGOTbc420L+C4f8kyB19xl0ilvbnmrdR5hRnUT+brbeD6oX33fTleL62ozhJRs0NGRVoq+opL1oWZmaqu4hBCyUhrFPpguC5opuCWZ1N+f+15M2SHNRgCME9FioYCb985cWR/DfBrgoCrK71QnxRMO3szfxcU1vejmgCnK1sh1xu5NLs01iREPICJubxrOvnAayN1bgkvXEW+ZX4G/SLqfbr9TPJeUr4Yc63IKcCva6HFPC590L0fiEu+bt8wYPG7J8mM/+XRSPp//BUtiLF0pXcalsC50cIHnM/4E0MFUlNybJSD8PLT6+n6ZzTi2QS0y7OHhLH8VblZpMev4HK08j3zCz3oxBkboF7fOATI5JYvkm4MB7cOp13liqLgLClLaMtOElFoy5eeoofMh9ZKeR+iZHveN5rLqAibxrjd4/5fyOexx1fiZvMarjaa3kAD9LH+iz5YTiJhimvqwt13N8z7W3e20L/8xpNTfXcOob7Zo1jttBK4Uc34itCnFPmfemp/s06qY3NEe8PdftQaia5jQr9kXIvSgLfULllZxzRnugF8pUz0P/UvuVp8XIws4+Bd+s7QeYmThp5s/ADyVMDhDSPXBDgdJT2ZB5c3wGoQNqJGS1nG7dXaZtvP2tsWEUzycomruOcWSqAXnWbJClNXMT/G/XM7Xg/UfJCZrJ6Xmj3P4D8faMxh3/NNwfUqe0PKiJfJNuw+Qt9Yhnt26ArhrlBM1gU3ZyrBNBmAi6qxChY+cxp0LLrd1oqvqcZBWIdZzrEGy6hXlGbbSsoXb0MhFbnh8/mP/dC2TKL8pkZCQ3dI59+HHUSIfqvlFRMLsIWOqPE4j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tQmMyx8oDapIsgJ1BAgLLvPZA80gp6FpbD5y1KrpZAvM0bCNInggPLi5NDope259i/SYWoA7CiAa0o1t8w/SUENDX1SDmoDAtZNb2Wakf3+5vfNoWMimXseAW0b0+KuIzwrf+0sVXHuoNNcqBoSXh0Mfst1xHpNwuykibihZZmp8HV8s/SS/lPGBeBiXPtx2CSuCu+GuLRqyKr/FYYggxM9cmFCctbRwbme82r+y2BA/MOYuIRlUH1oemRU6u5iUQCDz9/A+A1wXXVyZsQn+hDl72NXPgsowdYj9JoBvZTZjlI8dxKMMhp50= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 132148f4-8a75-4b4d-00cb-08dce4563519 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 09:23:29.0258 (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: o2LAVwZQwqAgCMoXHLVby3GxWHWfMdAAgXtvhfkOIFjXCuxmF13B3cDPOwItQH/SjMX9iFYMhA6MqxJw5ggDPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6900 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-04_06,2024-10-03_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 malwarescore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410040068 X-Proofpoint-GUID: WIcIm2G8_eJceelTyYMssxjdBhJQXVnp X-Proofpoint-ORIG-GUID: WIcIm2G8_eJceelTyYMssxjdBhJQXVnp Support providing info on atomic write unit min and max for an inode. For simplicity, currently we limit the min at the FS block size. As for max, we limit also at FS block size, as there is no current method to guarantee extent alignment or granularity for regular files. Reviewed-by: "Darrick J. Wong" Signed-off-by: John Garry --- fs/xfs/xfs_inode.h | 17 +++++++++++++++++ fs/xfs/xfs_iops.c | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 1c62ee294a5a..1ea73402d592 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -332,6 +332,23 @@ static inline bool xfs_inode_has_atomicwrites(struct xfs_inode *ip) return ip->i_diflags2 & XFS_DIFLAG2_ATOMICWRITES; } +static inline bool +xfs_inode_can_atomicwrite( + struct xfs_inode *ip) +{ + struct xfs_mount *mp = ip->i_mount; + struct xfs_buftarg *target = xfs_inode_buftarg(ip); + + if (!xfs_inode_has_atomicwrites(ip)) + return false; + if (mp->m_sb.sb_blocksize < target->bt_bdev_awu_min) + return false; + if (mp->m_sb.sb_blocksize > target->bt_bdev_awu_max) + return false; + + return true; +} + /* * In-core inode flags. */ diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index ee79cf161312..919fbcb4b72a 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -570,6 +570,23 @@ xfs_stat_blksize( return max_t(uint32_t, PAGE_SIZE, mp->m_sb.sb_blocksize); } +static void +xfs_get_atomic_write_attr( + struct xfs_inode *ip, + unsigned int *unit_min, + unsigned int *unit_max) +{ + struct xfs_mount *mp = ip->i_mount; + struct xfs_sb *sbp = &mp->m_sb; + + if (!xfs_inode_can_atomicwrite(ip)) { + *unit_min = *unit_max = 0; + return; + } + + *unit_min = *unit_max = sbp->sb_blocksize; +} + STATIC int xfs_vn_getattr( struct mnt_idmap *idmap, @@ -643,6 +660,14 @@ xfs_vn_getattr( stat->dio_mem_align = bdev_dma_alignment(bdev) + 1; stat->dio_offset_align = bdev_logical_block_size(bdev); } + if (request_mask & STATX_WRITE_ATOMIC) { + unsigned int unit_min, unit_max; + + xfs_get_atomic_write_attr(ip, &unit_min, + &unit_max); + generic_fill_statx_atomic_writes(stat, + unit_min, unit_max); + } fallthrough; default: stat->blksize = xfs_stat_blksize(ip);