Message ID | 20240923063732.2730521-1-bo.wu@vivo.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-f2fs-devel-bounces@lists.sourceforge.net> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46EF4CF9C6F for <linux-f2fs-devel@archiver.kernel.org>; Mon, 23 Sep 2024 06:22:12 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from <linux-f2fs-devel-bounces@lists.sourceforge.net>) id 1sscSY-0006iU-GY; Mon, 23 Sep 2024 06:22:09 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <bo.wu@vivo.com>) id 1sscSW-0006iK-GE for linux-f2fs-devel@lists.sourceforge.net; Mon, 23 Sep 2024 06:22:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=N8i4d5da9yORPmkip5timpzrA2WyEM4mn5EMx6DjBug=; b=mib57m4nyfXAEvXNw12kO0Qxim tmf2Mz67G8FHGllKhx4NTUxlCITERyIziGRu/81tScZ0ALHTDMLtu9gi45VimCVzLoiF6gmE/XrXV dnV7NLM/DCm/L3NLdUSlb0zmGoLPpCWE4L8CD8A635uDG/sZ4cr8ygZMMnUwTMWZza50=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=N8i4d5da9yORPmkip5timpzrA2WyEM4mn5EMx6DjBug=; b=K LSrNsSk/BTMO79O0BYWCgjtvwC6gDXDq9k6eyWnwlwZnPKOhRw3lqBdr4RC4nK42k4kFmm0mXekIA L0k/ycN6hSnqt3a3tU6XmZ5Oj31UlUewCy8r4RT/6Ud82rYe53HG6qQODcHotJJckduhv4R7GBLqH NbZr5UzuizZuz9Sc=; Received: from mail-sgaapc01on2059.outbound.protection.outlook.com ([40.107.215.59] helo=APC01-SG2-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sscSU-0000kW-QV for linux-f2fs-devel@lists.sourceforge.net; Mon, 23 Sep 2024 06:22:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t1oV1Q6QycdNMC+qA1poWxsI0//lcb2XOpIHeXfzxoVdt4zhH3I5xBcFmHzXq40JROjjvasV1DE/XJOa42VPMxakD7Saqj9p56LXxVzUJ7f73yUKbG5kqTBYmismGbhWu1kVABVWmFhQ1m+EKuuHgtAZ5TnSwNHHr7TJXG1+P5InjQLgVOAH5V7w2EJdWrzOBsG3qnO61R+/91hwNGltgLmAWqTdRNDlHdR7QjBsIoD8ALmYnYwCaEMGpZUmICTshGaZtzXFPEg6c+TRvyt5d3h4fjO9m283I+WxhcCIWX4Nm0gN/bnIJu34TeRW/Zfkun26qe/IOm6Fwycq6hTq9g== 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=N8i4d5da9yORPmkip5timpzrA2WyEM4mn5EMx6DjBug=; b=qFFmrYAQ1PRKa/lFLRKahdYOqYZpSaTgoI/0+DfewInfJlO8rUY25DgW7TgayPFuY4huo410Rm9yc50q9od7p8AiJDkPSnNfU/AynTe2QdIk5UoADEdxVG1xH3md9rfzV854CwutJT+81GUoW8n8OZY7GLI0anvLqBbugIqWN7iJBPuHKbSMurls4E99FmRSbqHdI/490mlfRw4iZp4pdNYRlX6duYaSOhM52B7a16alOwBD0KLMlTy8YC5XoXFGdCxb7eTS67reztsWsq3+T2KeL637mUIf0RLhvMqQqSeqUbcBwNYTEVjll8CRQmp7P6ZnSI5Zt1nRPi+RYmKoWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N8i4d5da9yORPmkip5timpzrA2WyEM4mn5EMx6DjBug=; b=JwiuYy+2ksHuZGhGeBuCXfBh8gNCTxASlZSag6PgaBk2VbcEzcXoFwxa4Zz0IS9FFLH6jFxFWYYkagxmbu2DoPauD7N8r3s7NJBmRx+3QPN5bqimiCXE60duFv0qdAwyyFav+Bmr+VUbDiKNr+aThMRnWdz7cSM1quPoPq+HklSA4jno4mZY8YoXvS60Qj5lMqcMmQNFY1yRXLhHSF+5Pe/dzFB9p033LxlWzSKphBwCZWzFnVuQ4zy+pNyS3oB2Lu9iK4cvxfQ5152SBndeLm0hiUJZqWFLTm7F3ylttEAM2xNOjwyXJfKSKQqGaAWHrdhYMqDpmAP26SpPx4z/Tw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) by KL1PR06MB6273.apcprd06.prod.outlook.com (2603:1096:820:ec::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 06:21:56 +0000 Received: from PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5]) by PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5%5]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 06:21:56 +0000 To: linux-kernel@vger.kernel.org Date: Mon, 23 Sep 2024 00:37:32 -0600 Message-Id: <20240923063732.2730521-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR01CA0179.apcprd01.prod.exchangelabs.com (2603:1096:4:28::35) To PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4486:EE_|KL1PR06MB6273:EE_ X-MS-Office365-Filtering-Correlation-Id: 37f6ef91-d6ab-496b-d0ae-08dcdb9805bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: XjM8xb6WfSpjqSGJGNO5xtAywNEC6YDeK+U3aLXWfpFPH51CHaYybVnw624Bpq2SqopJ+3K/0ix+4+tSxSR4TCFtu/txvgFJMRUaeWFUnAYBLOofyCXXIN55UMSsdn8cHju7d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oNpupuZOaIJv7UovpVzi5m+lx3Zu+y6LtHYA4e6NA7I/Z29HI51JcZQWy2JVuA+WlLJ41puYBMUis6mnOMZ4bUBWUK3UtYBRUe8sMs9W2ZoLGSkE0yqQmYwCN3/6lN7ag6k4boiOs9zO2mqVr7Di2UFhJAY3HEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PSAPR06MB4486.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i7yL8/+yyp8/vaixGEw/rFADmhJKbgskRFeNH9WTreHSrcxuValRRSi8TyJRs+AoxdjU+nySduH8JqpLvP2qE6Uzd1ar1ZEmC4sRgowBTsDouR7XPE3YsKx7bqxdGsbSX0G7tmQbY5IFdODodecXoPN4jwDUegjal++Z/8UEKef2aoNBulFA3Oet56Q9if2zf6cVVOy0e0DKPnm1xGttUpvL3F69e5Sw6wIXcU5Zzjqou/ckRrcup+IYVto8HXcS2WILPbMTk7wm3JnZo/szewlBADC5jHfO0z7toePq2ZcBhEbahbC1fzzpJhibj6y07TP6tB0HH2frFRAqvlfPJ8o52cNurU9vQ+vFCcyokfhyJG8xifPEL1jvgA86Rlsw/g6RA7cnZY8dfVhZfSZQK9Y76BEt16BBMydLYK6l/botA8pRcdlBk5hhZb5/9kUztDz0T5/oQCDJ2dNPno77ktuLR/ZaymRU+LYBWx7QXW1CAUJNUJZUlmPeKQXuYQbXcb/+XBG9kQXEBDAHGKPdx3n3X/QjLwYCxo58toJ5Rvi7X6MdU9I1iD4R3mw143+1EAfFJGBgRlg4Nc/8wVyjQOECefIE89+bdr8Ly9t8UAjOZ2lFIVLYP3gYTMDKmnBP76o8OkERHdS59jnF11e/t4LUypUhc5x1j3pXTr012cgyFLo89mzIQusTBRVW+7V6yOSuuo3spbCxjjm72dzyaInOHEAgKDfF+rnCvZ2Sdr4M5vdiltYnmZ2f8Yca5mnElb9dosPFmxDnBLnIkZip2x6uFrB2TZqe3dSJCSg9UN6PY4cXgFGM7T6M1GTVIkuiK42pmwI05GNWZlThuWc6wX6jxF0cu4MeMuA9zxlq8cRTYtHhL4bGcllyi9wv8VqPY+bVJUMd4pNzL7jzZZKg6BAGF2do7hMy2S5b4ouuCTr5mhVNA0p5v7ZVr/eBRYpEqyH8V5cxKgyxUlgObNRyAWSjd6VOx+NY1OraPzmA8tgKSDCCIBriOli+VoNQV6wHo7RbHr7Z6XLW7+8VU39Vx1R0KWTHehW2fJ7VPzEh9KYAVLVepu1/HFY2rOgw4+kmje5VwVsejhRrihGUX55O8SZ7/xAUpf1JVcIJ+0klhXgiUHzJjYzoc2nlecO3CCdCxuTp+x+uZUTLF2UqMNzZEK0gsHaEiDB7VYzEqz9UcPBsAScgZChPaExtJO2Bz5XvEbLwnSfc/1JZv8/vUB03ojEQi+9WENHlbTCww/nMk86YVC8eUp0o/KHPI+O5LlASID/mavvOUe3KJwUTTIrxjWyV0mloGA0NLiZ1qh7pTXYmwMQJ00KOOg3QyvO3/43nIQpunqpjh+tRUkoKIdBQL3l7foWbJNGR4JWJk/3ng3mv8GtpbgRBbWoEFqBLneloVqEyR1Ag0adVybBqiUN+0iFVDmxKgGdgxS5Zh1KkiNB9qHoqbDshgrFkQulOvainjwterM7rCUz+ab5jEXjlO3GWNRd1tzmWwg8sNtO899cjDsmzN4DJPTh+8O+llJTSRQQh9VtzHlb2e2o5KMSzhk/GEZki63RM2qQNs8m+Mgd3Ae+NNu7M2/yzeNAJVkEo X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37f6ef91-d6ab-496b-d0ae-08dcdb9805bc X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 06:21:56.0695 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pWFMALCb7guTiFUkInIniPar17634EufSGZ0TTA5C31QsDoYB56fsGr/NAk4a9DiYYCk7vLGBk1VhdVjnM9cHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6273 X-Headers-End: 1sscSU-0000kW-QV Subject: [f2fs-dev] [PATCH] f2fs: do not set STATX_DIOALIGN if dio is not supported X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-f2fs-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/linux-f2fs-devel>, <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=linux-f2fs-devel> List-Post: <mailto:linux-f2fs-devel@lists.sourceforge.net> List-Help: <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel>, <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=subscribe> From: Wu Bo via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net> Reply-To: Wu Bo <bo.wu@vivo.com> Cc: Wu Bo <wubo.oduw@gmail.com>, Jaegeuk Kim <jaegeuk@kernel.org>, Wu Bo <bo.wu@vivo.com>, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net |
Series |
[f2fs-dev] f2fs: do not set STATX_DIOALIGN if dio is not supported
|
expand
|
On Mon, Sep 23, 2024 at 12:37:32AM -0600, Wu Bo via Linux-f2fs-devel wrote: > Therefore, if the filesystem does not support DIO, it should not set > the STATX_DIOALIGN flag. No, that's incorrect. STATX_DIOALIGN supports reporting that DIO is unsupported, via the alignments being 0. See the statx man page. - Eric
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 168f08507004..bbb66be0deba 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -908,14 +908,13 @@ int f2fs_getattr(struct mnt_idmap *idmap, const struct path *path, * f2fs sometimes supports DIO reads but not DIO writes. STATX_DIOALIGN * cannot represent that, so in that case we report no DIO support. */ - if ((request_mask & STATX_DIOALIGN) && S_ISREG(inode->i_mode)) { + if ((request_mask & STATX_DIOALIGN) && S_ISREG(inode->i_mode) && + !f2fs_force_buffered_io(inode, WRITE)) { unsigned int bsize = i_blocksize(inode); stat->result_mask |= STATX_DIOALIGN; - if (!f2fs_force_buffered_io(inode, WRITE)) { - stat->dio_mem_align = bsize; - stat->dio_offset_align = bsize; - } + stat->dio_mem_align = bsize; + stat->dio_offset_align = bsize; } flags = fi->i_flags;
According to the definition of statx.stx_mask: It simply informs the caller which values are supported by the kernel and filesystem via the statx.stx_mask field. (quote from the "Linux Programmer's Manual"). Therefore, if the filesystem does not support DIO, it should not set the STATX_DIOALIGN flag. Signed-off-by: Wu Bo <bo.wu@vivo.com> --- fs/f2fs/file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)