Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Namjae Jeon <linkinjeon@kernel.org>
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,
	ChenXiaoSong <chenxiaosong@kylinos.cn>
Subject: Re: [PATCH v8 1/1] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h
Date: Mon, 17 Nov 2025 08:08:56 +0800	[thread overview]
Message-ID: <0219f68e-32f6-4511-9ccc-698b77ea12de@linux.dev> (raw)
In-Reply-To: <d7682150-7af6-45a3-bc19-251d806e1c7f@linux.dev>

And in the following part of the SMB2_QFS_attr() function, it also seems 
that we should change it to `memcpy(..., min_t(..., min_len))`.

```c
SMB2_QFS_attr()
{
...
	if (level == FS_ATTRIBUTE_INFORMATION)
	        memcpy(&tcon->fsAttrInfo, offset
	                + (char *)rsp, min_t(unsigned int,
	                rsp_len, max_len));
...
}
```

Thanks,
ChenXiaoSong.

On 11/17/25 7:47 AM, ChenXiaoSong wrote:
> Yes, we should also add MAX_FS_NAME_LEN here. This was my mistake.
> 
> Thanks,
> ChenXiaoSong.
> 
> On 11/17/25 7:00 AM, Namjae Jeon wrote:
>> On Sun, Nov 16, 2025 at 3:53 PM <chenxiaosong.chenxiaosong@linux.dev> 
>> wrote:
>>>
>>> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>>>
>>> Modify the following places:
>>>
>>>    - struct filesystem_attribute_info -> FILE_SYSTEM_ATTRIBUTE_INFO
>>>    - Remove MIN_FS_ATTR_INFO_SIZE definition
>>>    - Introduce MAX_FS_NAME_LEN
>>>    - max_len of FileFsAttributeInformation -> 
>>> sizeof(FILE_SYSTEM_ATTRIBUTE_INFO) + MAX_FS_NAME_LEN
>>>    - min_len of FileFsAttributeInformation -> 
>>> 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>
>>
>> Did you check if it is being used here too?
>> cifssmb.c:4866:        sizeof(FILE_SYSTEM_ATTRIBUTE_INFO));
> 


  reply	other threads:[~2025-11-17  0:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-16  6:52 [PATCH v8 0/1] smb: move duplicate definitions to common header file chenxiaosong.chenxiaosong
2025-11-16  6:52 ` [PATCH v8 1/1] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h chenxiaosong.chenxiaosong
2025-11-16 23:00   ` Namjae Jeon
2025-11-16 23:47     ` ChenXiaoSong
2025-11-17  0:08       ` ChenXiaoSong [this message]
2025-11-17  1:04     ` ChenXiaoSong
2025-11-17  1:06     ` ChenXiaoSong

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=0219f68e-32f6-4511-9ccc-698b77ea12de@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=chenxiaosong@chenxiaosong.com \
    --cc=chenxiaosong@kylinos.cn \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox