From patchwork Thu May 18 11:47:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13246633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD29C77B7A for ; Thu, 18 May 2023 11:48:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F34F280008; Thu, 18 May 2023 07:48:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57D5D280001; Thu, 18 May 2023 07:48:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41DB7280008; Thu, 18 May 2023 07:48:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 326F1280001 for ; Thu, 18 May 2023 07:48:03 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E7723C05D1 for ; Thu, 18 May 2023 11:48:02 +0000 (UTC) X-FDA: 80803202004.24.41AB718 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id 46BBE180011 for ; Thu, 18 May 2023 11:48:01 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pv9NSU1e; spf=pass (imf24.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684410481; a=rsa-sha256; cv=none; b=Ie3VYjqLdMK8i04lHhkumpU3J0EGqKj0D957IOxU1rHqdJlVtzZ+Ak/Zu9jRAVaFpzFHhZ NNFmOPOWidLGUNM7Xmqvq5GM7SQ0RVyT6JQTRbtf9eGfeaoQ7FzqOhUFmY+Jh4BQBYe9Gi vQ1Nm2C2KdMzKkWJVks7vNu6x36eD7k= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pv9NSU1e; spf=pass (imf24.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684410481; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IJgQ18FYI+xs9FDD5lKBcw8Ak01NNxhHvPgnEm2MRog=; b=GpXSJ8ZDdoO9nu1jIuT+mI5GHueTe6r9BqJp3tPD6Rs2ZBd62aeyJrTuc81SqTJjJb9iee SGdkVD5EhCYRt3PtWEInlGqIBy4yk/9gRbdSNH4As9gONhPTYMhtO9MkQTlK2pPBr5B8FF rZIkBtXoLcFU4ZMidPZcQeOm+dKYxdQ= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6837A64ED9; Thu, 18 May 2023 11:48:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77283C433A1; Thu, 18 May 2023 11:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684410479; bh=wTAnemCjoVMdBCyfBm7Caga87wrGLLdiUMBAcBipLM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pv9NSU1eFgIMWnOukE0vFtlSJhvEzj0TZb3+gBxSbV4qnUliBKBhdy87cs9IAXHTQ 1dMxyJ0MCSwcxOHa0adG7hzskt16qlLg6oamqDb76RXfskYjsZM5o0JxuTo/WFc897 VcFtzIuIMOGA47SH7EdySeITog2TKUoLRdLffRTpA7WrjOcjjvIVsAT/189C9RgPwh YJ2blX4n6Pm7QyDIP3ewgeAI6b3YJEbz4lUXoiFKczZaUeQvD+QwwzqUFJd6f3EYkC +6ZEtMgGqziZq7hwGRaYwIsAUtBQD/dTP/9CtCnpQcrkIjmmiHoBVgsfu4UY3Vycc5 mjFdNmAgburFQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , "Darrick J. Wong" , Hugh Dickins , Andrew Morton , Dave Chinner , Chuck Lever Cc: Jan Kara , Amir Goldstein , David Howells , Neil Brown , Matthew Wilcox , Andreas Dilger , Theodore T'so , Chris Mason , Josef Bacik , David Sterba , Namjae Jeon , Steve French , Sergey Senozhatsky , Tom Talpey , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org Subject: [PATCH v4 5/9] ksmbd: use ctime_peek to grab the ctime out of the inode Date: Thu, 18 May 2023 07:47:38 -0400 Message-Id: <20230518114742.128950-6-jlayton@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518114742.128950-1-jlayton@kernel.org> References: <20230518114742.128950-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 46BBE180011 X-Stat-Signature: 5gd9ffehd873jy69q9fonrtynj8yzr8h X-HE-Tag: 1684410481-126335 X-HE-Meta: U2FsdGVkX1+B+doR0NbjgvZ6YPetxusFoIijfj73fnaaUg1d3qfw6V/uwMBX+TVD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db8/EY73Aqcfisp44rGmsju0lyIU9ika1A+BULrrxWA674b5hjpLqnKr1k87f6dk1TgWPdQryuG1TrR4ryp3RLNrHSsZRL7dTq5aGJ6fToW/Ea6834JX1B0MPxX+CFGQdOjEu1Sxn0Vo2RsJVRlx69CzE3ukg7oKf2WYWTzXPYDUVMhWgB78VmGWDEIXiYf7pkAdLNuFNBN5OjARtOPEw8c8wMYVIe1/q9qxEbNdE+E7S X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This ensures that the flag is masked off in the result. Signed-off-by: Jeff Layton --- fs/ksmbd/smb2pdu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index d39ddb344417..c33128570448 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -4745,7 +4745,7 @@ static int find_file_posix_info(struct smb2_query_info_rsp *rsp, file_info->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); file_info->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(ctime_peek(inode)); file_info->ChangeTime = cpu_to_le64(time); file_info->DosAttributes = fp->f_ci->m_fattr; file_info->Inode = cpu_to_le64(inode->i_ino); @@ -5386,7 +5386,7 @@ int smb2_close(struct ksmbd_work *work) rsp->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); rsp->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(ctime_peek(inode)); rsp->ChangeTime = cpu_to_le64(time); ksmbd_fd_put(work, fp); } else { @@ -5605,7 +5605,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, if (file_info->ChangeTime) attrs.ia_ctime = ksmbd_NTtimeToUnix(file_info->ChangeTime); else - attrs.ia_ctime = inode->i_ctime; + attrs.ia_ctime = ctime_peek(inode); if (file_info->LastWriteTime) { attrs.ia_mtime = ksmbd_NTtimeToUnix(file_info->LastWriteTime);