[lvc-project] [PATCH] fix error code overwriting in smb2_get_info_filesystem()

Markus Elfring Markus.Elfring at web.de
Fri Sep 26 15:28:04 MSK 2025


…
> ++ b/fs/smb/server/smb2pdu.c
> @@ -5628,7 +5628,8 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
>  
>  		if (!work->tcon->posix_extensions) {
>  			pr_err("client doesn't negotiate with SMB3.1.1 POSIX Extensions\n");
> -			rc = -EOPNOTSUPP;
> +			path_put(&path);
> +			return -EOPNOTSUPP;
>  		} else {
>  			info = (struct filesystem_posix_info *)(rsp->Buffer);
>  			info->OptimalTransferSize = cpu_to_le32(stfs.f_bsize);
…

How do you think about to avoid duplicate source code another bit?
https://elixir.bootlin.com/linux/v6.17-rc7/source/fs/smb/server/smb2pdu.c#L5437-L5653
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.17-rc7#n532

Would you like to choose a more appropriate subsystem specification?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc7#n646

Regards,
Markus



More information about the lvc-project mailing list