All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Namjae Jeon <linkinjeon@kernel.org>, chenxiaosong.chenxiaosong@linux.dev
Cc: sfrench@samba.org, smfrench@gmail.com, linkinjeon@samba.org,
	christophe.jaillet@wanadoo.fr, linux-cifs@vger.kernel.org,
	linux-kernel@vger.kernel.org, chenxiaosong@chenxiaosong.com
Subject: Re: [PATCH v7 2/2] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h
Date: Sat, 15 Nov 2025 16:06:40 +0800	[thread overview]
Message-ID: <bb4597b3-65cb-4170-8f15-796ee78b1d5b@linux.dev> (raw)
In-Reply-To: <CAKYAXd-E2sSk-8Kw3uZPm-CH8KSr8h0fcCvjFm2YK3eyN1BC3g@mail.gmail.com>

It seems we need to add 52 to `max_len` in the `SMB2_QFS_attr()` 
function, similar to struct smb3_fs_vol_info.

Or we can temporarily use the v5 version for now? v5: 
https://lore.kernel.org/all/20251102073059.3681026-13-chenxiaosong.chenxiaosong@linux.dev/

Thanks,
ChenXiaoSong.

On 11/15/25 15:41, Namjae Jeon wrote:
> On Thu, Nov 13, 2025 at 10:34 PM <chenxiaosong.chenxiaosong@linux.dev> wrote:
>>
>> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>>
>> Modify the following places:
>>
>>    - struct filesystem_attribute_info -> FILE_SYSTEM_ATTRIBUTE_INFO
>>    - client: remove MIN_FS_ATTR_INFO_SIZE definition,
>>              MIN_FS_ATTR_INFO_SIZE -> sizeof(FILE_SYSTEM_ATTRIBUTE_INFO)
>>
>> Then move FILE_SYSTEM_ATTRIBUTE_INFO to common header file.
>>
>> Suggested-by: Namjae Jeon <linkinjeon@kernel.org>
>> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
>> ---
>>   fs/smb/client/cifspdu.h    | 10 ----------
>>   fs/smb/client/smb2pdu.c    |  2 +-
>>   fs/smb/common/fscc.h       |  8 ++++++++
>>   fs/smb/server/smb2pdu.c    |  6 +++---
>>   fs/smb/server/smb_common.h |  7 -------
>>   5 files changed, 12 insertions(+), 21 deletions(-)
>>
>> diff --git a/fs/smb/client/cifspdu.h b/fs/smb/client/cifspdu.h
>> index d84e10b1477f..49f35cb3cf2e 100644
>> --- a/fs/smb/client/cifspdu.h
>> +++ b/fs/smb/client/cifspdu.h
>> @@ -2068,16 +2068,6 @@ typedef struct {
>>   #define FILE_PORTABLE_DEVICE                   0x00004000
>>   #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
>>
>> -/* minimum includes first three fields, and empty FS Name */
>> -#define MIN_FS_ATTR_INFO_SIZE 12
>> -
>> -typedef struct {
>> -       __le32 Attributes;
>> -       __le32 MaxPathNameComponentLength;
>> -       __le32 FileSystemNameLen;
>> -       char FileSystemName[52]; /* do not have to save this - get subset? */
>> -} __attribute__((packed)) FILE_SYSTEM_ATTRIBUTE_INFO;
>> -
>>   /******************************************************************************/
>>   /* QueryFileInfo/QueryPathinfo (also for SetPath/SetFile) data buffer formats */
>>   /******************************************************************************/
>> diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
>> index 30c391424022..4ccc8d1e130d 100644
>> --- a/fs/smb/client/smb2pdu.c
>> +++ b/fs/smb/client/smb2pdu.c
>> @@ -5982,7 +5982,7 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
>>                  min_len = sizeof(FILE_SYSTEM_DEVICE_INFO);
>>          } else if (level == FS_ATTRIBUTE_INFORMATION) {
>>                  max_len = sizeof(FILE_SYSTEM_ATTRIBUTE_INFO);
>> -               min_len = MIN_FS_ATTR_INFO_SIZE;
>> +               min_len = sizeof(FILE_SYSTEM_ATTRIBUTE_INFO);
> FILE_SYSTEM_ATTRIBUTE_INFO is being used elsewhere on the smb client,
> and there are cases where sizeof(FILE_SYSTEM_ATTRIBUTE_INFO) is being
> used. Will there really be no problems if we change it to flex-array?


      reply	other threads:[~2025-11-15  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 13:32 [PATCH v7 0/2] smb: move duplicate definitions to common header file chenxiaosong.chenxiaosong
2025-11-13 13:32 ` [PATCH v7 1/2] smb: move CREATE_DURABLE_RECONN to common/smb2pdu.h chenxiaosong.chenxiaosong
2025-11-15  7:45   ` Namjae Jeon
2025-11-13 13:32 ` [PATCH v7 2/2] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h chenxiaosong.chenxiaosong
2025-11-15  7:41   ` Namjae Jeon
2025-11-15  8:06     ` ChenXiaoSong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb4597b3-65cb-4170-8f15-796ee78b1d5b@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=chenxiaosong@chenxiaosong.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=linkinjeon@kernel.org \
    --cc=linkinjeon@samba.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.