{"id":2196719,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2196719/?format=json","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.0/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260216082018.156695-4-zhang.guodong@linux.dev>","date":"2026-02-16T08:20:16","name":"[v3,3/5] smb: move file_basic_info into common/fscc.h","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"ffeea4df9d059f1d91b7d1593282ec4b337f26e5","submitter":{"id":92649,"url":"http://patchwork.ozlabs.org/api/1.0/people/92649/?format=json","name":"ZhangGuoDong","email":"zhang.guodong@linux.dev"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260216082018.156695-4-zhang.guodong@linux.dev/mbox/","series":[{"id":492258,"url":"http://patchwork.ozlabs.org/api/1.0/series/492258/?format=json","date":"2026-02-16T08:20:13","name":"smb: move duplicate definitions into common header file, part 2","version":3,"mbox":"http://patchwork.ozlabs.org/series/492258/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2196719/checks/","tags":{},"headers":{"Return-Path":"\n <linux-cifs+bounces-9393-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=xeya6LSC;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-9393-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=\"xeya6LSC\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=95.215.58.181","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.dev"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fDwk44lT6z1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 19:22:20 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 1FEA7300CE6A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 08:21:57 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C7E5D2475E3;\n\tMon, 16 Feb 2026 08:21:55 +0000 (UTC)","from out-181.mta1.migadu.com (out-181.mta1.migadu.com\n [95.215.58.181])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FB122475CB\n\tfor <linux-cifs@vger.kernel.org>; Mon, 16 Feb 2026 08:21:54 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771230115; cv=none;\n b=IroW+pgYjm0JRSfUZkG82V/ht6qfhYPg5cX9naQzYRdlFMuvlN2ySUfDR6e7T37mH6XkoTo0/ChUjaKHPLoMsXSd9CB7/LNqeLxEZcGR/YqUaWgsTNsbhyWuRAzYABvJx0gcvYSbYWXQ+T1XPsI4DMEeQmiAcXzHQRzYWuAUAaQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771230115; c=relaxed/simple;\n\tbh=kW0NZ3VURiZI5kFVaINntqWPzReH7mvPcxSDjdGbeKw=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=pwZ6Y6X3KSbYL3l/sKLr2vssoM6iEaZwGU4pAyIetiW2faytEnBtPpy8u5IFIvy4mo3wCOW06ruPBDKzMNHdiirLLgJuqh0YoiKv4JTtCeBz6tJwkoFxfnyZ42UnLN7AFZgPtqbnLq6aB2wMZhjRMCI360ZJQzvhUxG1Gz/JVV4=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev;\n spf=pass smtp.mailfrom=linux.dev;\n dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=xeya6LSC; arc=none smtp.client-ip=95.215.58.181","X-Report-Abuse":"Please report any abuse attempt to abuse@migadu.com and\n include these headers.","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1771230112;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=GG5ya13+Zw7utW/8fmayeQSUgRPluhO4EyRv1y2z15k=;\n\tb=xeya6LSCGaelGXP9Rt29QCkKRk3SZsnPgpE4Ke4b3gI56yIU4e63e36rAz/kcMmyUtncdE\n\tdJKd4Xqr7c8h8F+Y8tVOVY2cUqyCfU8aygKQOJMcQGMYuT/ArMhKAbbvsjj9EKhJr7FHCK\n\tldXWPoZVok2lg+FxtA/xsvRyVsdtWkE=","From":"zhang.guodong@linux.dev","To":"smfrench@gmail.com,\n\tlinkinjeon@kernel.org,\n\tpc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\tsenozhatsky@chromium.org,\n\tdhowells@redhat.com,\n\tchenxiaosong@kylinos.cn,\n\tchenxiaosong.chenxiaosong@linux.dev","Cc":"linux-cifs@vger.kernel.org,\n\tZhangGuoDong <zhangguodong@kylinos.cn>","Subject":"[PATCH v3 3/5] smb: move file_basic_info into common/fscc.h","Date":"Mon, 16 Feb 2026 08:20:16 +0000","Message-ID":"<20260216082018.156695-4-zhang.guodong@linux.dev>","In-Reply-To":"<20260216082018.156695-1-zhang.guodong@linux.dev>","References":"<20260216082018.156695-1-zhang.guodong@linux.dev>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Migadu-Flow":"FLOW_OUT"},"content":"From: ZhangGuoDong <zhangguodong@kylinos.cn>\n\nThis struct definition is specified in MS-FSCC, so move them into fscc.h.\n\nModify the following places:\n\n  - smb2_file_basic_info -> file_basic_info\n  - Pad1 -> Pad\n\nSigned-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/smb1pdu.h |  9 ---------\n fs/smb/common/fscc.h    | 10 ++++++++++\n fs/smb/server/smb2pdu.c | 14 +++++++-------\n fs/smb/server/smb2pdu.h |  9 ---------\n 4 files changed, 17 insertions(+), 25 deletions(-)","diff":"diff --git a/fs/smb/client/smb1pdu.h b/fs/smb/client/smb1pdu.h\nindex 97f7e1244a8b..7584e94d9b2b 100644\n--- a/fs/smb/client/smb1pdu.h\n+++ b/fs/smb/client/smb1pdu.h\n@@ -2061,15 +2061,6 @@ typedef struct {\n \t__le32 EASize;\n } __packed FILE_INFO_STANDARD;  /* level 1 SetPath/FileInfo */\n \n-typedef struct {\n-\t__le64 CreationTime;\n-\t__le64 LastAccessTime;\n-\t__le64 LastWriteTime;\n-\t__le64 ChangeTime;\n-\t__le32 Attributes;\n-\t__u32 Pad;\n-} __packed FILE_BASIC_INFO;\t/* size info, level 0x101 */\n-\n struct file_allocation_info {\n \t__le64 AllocationSize; /* Note old Samba srvr rounds this up too much */\n } __packed; /* size used on disk, for level 0x103 for set, 0x105 for query */\ndiff --git a/fs/smb/common/fscc.h b/fs/smb/common/fscc.h\nindex b209d818e95e..716864b173fd 100644\n--- a/fs/smb/common/fscc.h\n+++ b/fs/smb/common/fscc.h\n@@ -216,6 +216,16 @@ struct smb2_file_all_info { /* data block encoding of response to level 18 */\n \t};\n } __packed; /* level 18 Query */\n \n+/* See MS-FSCC 2.4.7 */\n+typedef struct file_basic_info { /* data block encoding of response to level 18 */\n+\t__le64 CreationTime;\n+\t__le64 LastAccessTime;\n+\t__le64 LastWriteTime;\n+\t__le64 ChangeTime;\n+\t__le32 Attributes;\n+\t__u32  Pad;\n+} __packed FILE_BASIC_INFO;\t/* size info, level 0x101 */\n+\n /* See MS-FSCC 2.4.8 */\n typedef struct {\n \t__le32 NextEntryOffset;\ndiff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c\nindex 966a499d2eb8..eb2129ab7156 100644\n--- a/fs/smb/server/smb2pdu.c\n+++ b/fs/smb/server/smb2pdu.c\n@@ -4838,7 +4838,7 @@ static void get_file_access_info(struct smb2_query_info_rsp *rsp,\n static int get_file_basic_info(struct smb2_query_info_rsp *rsp,\n \t\t\t       struct ksmbd_file *fp, void *rsp_org)\n {\n-\tstruct smb2_file_basic_info *basic_info;\n+\tstruct file_basic_info *basic_info;\n \tstruct kstat stat;\n \tu64 time;\n \tint ret;\n@@ -4854,7 +4854,7 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp,\n \tif (ret)\n \t\treturn ret;\n \n-\tbasic_info = (struct smb2_file_basic_info *)rsp->Buffer;\n+\tbasic_info = (struct file_basic_info *)rsp->Buffer;\n \tbasic_info->CreationTime = cpu_to_le64(fp->create_time);\n \ttime = ksmbd_UnixTimeToNT(stat.atime);\n \tbasic_info->LastAccessTime = cpu_to_le64(time);\n@@ -4863,9 +4863,9 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp,\n \ttime = ksmbd_UnixTimeToNT(stat.ctime);\n \tbasic_info->ChangeTime = cpu_to_le64(time);\n \tbasic_info->Attributes = fp->f_ci->m_fattr;\n-\tbasic_info->Pad1 = 0;\n+\tbasic_info->Pad = 0;\n \trsp->OutputBufferLength =\n-\t\tcpu_to_le32(sizeof(struct smb2_file_basic_info));\n+\t\tcpu_to_le32(sizeof(struct file_basic_info));\n \treturn 0;\n }\n \n@@ -6136,7 +6136,7 @@ static int smb2_create_link(struct ksmbd_work *work,\n }\n \n static int set_file_basic_info(struct ksmbd_file *fp,\n-\t\t\t       struct smb2_file_basic_info *file_info,\n+\t\t\t       struct file_basic_info *file_info,\n \t\t\t       struct ksmbd_share_config *share)\n {\n \tstruct iattr attrs;\n@@ -6418,10 +6418,10 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,\n \tswitch (req->FileInfoClass) {\n \tcase FILE_BASIC_INFORMATION:\n \t{\n-\t\tif (buf_len < sizeof(struct smb2_file_basic_info))\n+\t\tif (buf_len < sizeof(struct file_basic_info))\n \t\t\treturn -EMSGSIZE;\n \n-\t\treturn set_file_basic_info(fp, (struct smb2_file_basic_info *)buffer, share);\n+\t\treturn set_file_basic_info(fp, (struct file_basic_info *)buffer, share);\n \t}\n \tcase FILE_ALLOCATION_INFORMATION:\n \t{\ndiff --git a/fs/smb/server/smb2pdu.h b/fs/smb/server/smb2pdu.h\nindex 257c6d26df26..9b3c4c9acb11 100644\n--- a/fs/smb/server/smb2pdu.h\n+++ b/fs/smb/server/smb2pdu.h\n@@ -183,15 +183,6 @@ struct smb2_file_alignment_info {\n \t__le32 AlignmentRequirement;\n } __packed;\n \n-struct smb2_file_basic_info { /* data block encoding of response to level 18 */\n-\t__le64 CreationTime;\t/* Beginning of FILE_BASIC_INFO equivalent */\n-\t__le64 LastAccessTime;\n-\t__le64 LastWriteTime;\n-\t__le64 ChangeTime;\n-\t__le32 Attributes;\n-\t__u32  Pad1;\t\t/* End of FILE_BASIC_INFO_INFO equivalent */\n-} __packed;\n-\n struct smb2_file_alt_name_info {\n \t__le32 FileNameLength;\n \tchar FileName[];\n","prefixes":["v3","3/5"]}