[PATCH] smb: smbdirect: select CONFIG_SG_POOL

Arnd Bergmann posted 1 patch 1 month ago
fs/smb/client/Kconfig | 1 +
1 file changed, 1 insertion(+)
[PATCH] smb: smbdirect: select CONFIG_SG_POOL
Posted by Arnd Bergmann 1 month ago
From: Arnd Bergmann <arnd@arndb.de>

The smbdirect code now uses the scatter/gather pool interface. This
causes a build failure when the interface is disabled:

In file included from fs/smb/client/../common/smbdirect/smbdirect_all_c_files.c:21,
                 from fs/smb/client/smbdirect.c:176:
fs/smb/client/../common/smbdirect/smbdirect_rw.c: In function 'smbdirect_connection_rw_io_free':
fs/smb/client/../common/smbdirect/smbdirect_rw.c:76:9: error: implicit declaration of function 'sg_free_table_chained' [-Wimplicit-function-declaration]
   76 |         sg_free_table_chained(&msg->sgt, SG_CHUNK_SIZE);
      |         ^~~~~~~~~~~~~~~~~~~~~

The other users of this interface all 'select SG_POOL', so so the same
here.

Fixes: 5ab0987c492e ("smb: smbdirect: introduce smbdirect_rw.c with server rw code")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/smb/client/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/client/Kconfig b/fs/smb/client/Kconfig
index 17bd368574e9..725422b45ef4 100644
--- a/fs/smb/client/Kconfig
+++ b/fs/smb/client/Kconfig
@@ -182,6 +182,7 @@ if CIFS
 config CIFS_SMB_DIRECT
 	bool "SMB Direct support"
 	depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y
+	select SG_POOL
 	help
 	  Enables SMB Direct support for SMB 3.0, 3.02 and 3.1.1.
 	  SMB Direct allows transferring SMB packets over RDMA. If unsure,
-- 
2.39.5
Re: [PATCH] smb: smbdirect: select CONFIG_SG_POOL
Posted by Stefan Metzmacher 1 month ago
Hi Arnd,

I'm wondering what the top commit is that you where compiling,
I guess that's before the 'smb: client: make use of smbdirect.ko'
commit.

As we have this at the end of the patchset in ksmbd-for-next:

fs/smb/common/smbdirect/Kconfig

config SMB_COMMON_SMBDIRECT
         def_tristate n
         depends on INFINIBAND && INFINIBAND_ADDR_TRANS
         depends on m || INFINIBAND != m
         select SG_POOL

I'll try to change the patches to have your hunk
in the temporary phase in the patchset where we use
smbdirect_all_c_files, as it's gone at the end of
the patchset.

Thanks!
metze

Am 16.02.26 um 11:54 schrieb Arnd Bergmann:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The smbdirect code now uses the scatter/gather pool interface. This
> causes a build failure when the interface is disabled:
> 
> In file included from fs/smb/client/../common/smbdirect/smbdirect_all_c_files.c:21,
>                   from fs/smb/client/smbdirect.c:176:
> fs/smb/client/../common/smbdirect/smbdirect_rw.c: In function 'smbdirect_connection_rw_io_free':
> fs/smb/client/../common/smbdirect/smbdirect_rw.c:76:9: error: implicit declaration of function 'sg_free_table_chained' [-Wimplicit-function-declaration]
>     76 |         sg_free_table_chained(&msg->sgt, SG_CHUNK_SIZE);
>        |         ^~~~~~~~~~~~~~~~~~~~~
> 
> The other users of this interface all 'select SG_POOL', so so the same
> here.
> 
> Fixes: 5ab0987c492e ("smb: smbdirect: introduce smbdirect_rw.c with server rw code")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   fs/smb/client/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/smb/client/Kconfig b/fs/smb/client/Kconfig
> index 17bd368574e9..725422b45ef4 100644
> --- a/fs/smb/client/Kconfig
> +++ b/fs/smb/client/Kconfig
> @@ -182,6 +182,7 @@ if CIFS
>   config CIFS_SMB_DIRECT
>   	bool "SMB Direct support"
>   	depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y
> +	select SG_POOL
>   	help
>   	  Enables SMB Direct support for SMB 3.0, 3.02 and 3.1.1.
>   	  SMB Direct allows transferring SMB packets over RDMA. If unsure,
Re: [PATCH] smb: smbdirect: select CONFIG_SG_POOL
Posted by Arnd Bergmann 1 month ago
On Mon, Feb 16, 2026, at 12:15, Stefan Metzmacher wrote:
> Hi Arnd,
>
> I'm wondering what the top commit is that you where compiling,
> I guess that's before the 'smb: client: make use of smbdirect.ko'
> commit.

I'm on today's linux-next-20260213, which contains 

4c91b67f87ac smb: client: fix data corruption due to racy lease checks
3774289f525c smb/client: move NT_STATUS_MORE_ENTRIES
617a5d2473dc smb/client: rename to NT_ERROR_INVALID_DATATYPE
fa34d0a57033 smb/client: rename to NT_STATUS_SOME_NOT_MAPPED
4da735c48a27 smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD
3e5f08342860 smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED
e4424687fc6d smb/client: map NT_STATUS_BUFFER_OVERFLOW
ba39063ca3ee smb/client: map NT_STATUS_NOTIFY_ENUM_DIR
66dc58bdbd7c cifs: SMB1 split: Remove duplicate include of cifs_debug.h
72f4d4803486 smb: client: fix regression with mount options parsing
72f4d4803486 smb: client: fix regression with mount options parsing
4c91b67f87ac smb: client: fix data corruption due to racy lease checks
3774289f525c smb/client: move NT_STATUS_MORE_ENTRIES
617a5d2473dc smb/client: rename to NT_ERROR_INVALID_DATATYPE
fa34d0a57033 smb/client: rename to NT_STATUS_SOME_NOT_MAPPED
4da735c48a27 smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD
3e5f08342860 smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED
e4424687fc6d smb/client: map NT_STATUS_BUFFER_OVERFLOW
ba39063ca3ee smb/client: map NT_STATUS_NOTIFY_ENUM_DIR
66dc58bdbd7c cifs: SMB1 split: Remove duplicate include of cifs_debug.h
72f4d4803486 smb: client: fix regression with mount options parsing
d53f4d93f3d6 Merge tag 'v7.0-rc-part1-ksmbd-and-smbdirect-fixes' of git://git.samba.org/ksmbd
8f7df60fe063 ("ksmbd: fix non-IPv6 build")
...

> As we have this at the end of the patchset in ksmbd-for-next:
>
> fs/smb/common/smbdirect/Kconfig

This file is not in linux-next as of today, as far as I can tell.

> config SMB_COMMON_SMBDIRECT
>          def_tristate n
>          depends on INFINIBAND && INFINIBAND_ADDR_TRANS
>          depends on m || INFINIBAND != m
>          select SG_POOL
>
> I'll try to change the patches to have your hunk
> in the temporary phase in the patchset where we use
> smbdirect_all_c_files, as it's gone at the end of
> the patchset.

Ok, thanks!

    Arnd
Re: [PATCH] smb: smbdirect: select CONFIG_SG_POOL
Posted by Stefan Metzmacher 1 month ago
Am 16.02.26 um 12:48 schrieb Arnd Bergmann:
> On Mon, Feb 16, 2026, at 12:15, Stefan Metzmacher wrote:
>> Hi Arnd,
>>
>> I'm wondering what the top commit is that you where compiling,
>> I guess that's before the 'smb: client: make use of smbdirect.ko'
>> commit.
> 
> I'm on today's linux-next-20260213, which contains
> 
> 4c91b67f87ac smb: client: fix data corruption due to racy lease checks
> 3774289f525c smb/client: move NT_STATUS_MORE_ENTRIES
> 617a5d2473dc smb/client: rename to NT_ERROR_INVALID_DATATYPE
> fa34d0a57033 smb/client: rename to NT_STATUS_SOME_NOT_MAPPED
> 4da735c48a27 smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD
> 3e5f08342860 smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED
> e4424687fc6d smb/client: map NT_STATUS_BUFFER_OVERFLOW
> ba39063ca3ee smb/client: map NT_STATUS_NOTIFY_ENUM_DIR
> 66dc58bdbd7c cifs: SMB1 split: Remove duplicate include of cifs_debug.h
> 72f4d4803486 smb: client: fix regression with mount options parsing
> 72f4d4803486 smb: client: fix regression with mount options parsing
> 4c91b67f87ac smb: client: fix data corruption due to racy lease checks
> 3774289f525c smb/client: move NT_STATUS_MORE_ENTRIES
> 617a5d2473dc smb/client: rename to NT_ERROR_INVALID_DATATYPE
> fa34d0a57033 smb/client: rename to NT_STATUS_SOME_NOT_MAPPED
> 4da735c48a27 smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD
> 3e5f08342860 smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED
> e4424687fc6d smb/client: map NT_STATUS_BUFFER_OVERFLOW
> ba39063ca3ee smb/client: map NT_STATUS_NOTIFY_ENUM_DIR
> 66dc58bdbd7c cifs: SMB1 split: Remove duplicate include of cifs_debug.h
> 72f4d4803486 smb: client: fix regression with mount options parsing
> d53f4d93f3d6 Merge tag 'v7.0-rc-part1-ksmbd-and-smbdirect-fixes' of git://git.samba.org/ksmbd
> 8f7df60fe063 ("ksmbd: fix non-IPv6 build")
> ...
> 
>> As we have this at the end of the patchset in ksmbd-for-next:
>>
>> fs/smb/common/smbdirect/Kconfig

Ah, ok, that was because Steve only had 1/3 of the patchset
applied last week.

So this problem should be gone in the next linux-next round,
will not have the problem.

> This file is not in linux-next as of today, as far as I can tell.
> 
>> config SMB_COMMON_SMBDIRECT
>>           def_tristate n
>>           depends on INFINIBAND && INFINIBAND_ADDR_TRANS
>>           depends on m || INFINIBAND != m
>>           select SG_POOL
>>
>> I'll try to change the patches to have your hunk
>> in the temporary phase in the patchset where we use
>> smbdirect_all_c_files, as it's gone at the end of
>> the patchset.

And once I tested my updated patchset and Steve
applied it, it should even work for every single
patch.

metze
Re: [PATCH] smb: smbdirect: select CONFIG_SG_POOL
Posted by Stefan Metzmacher 1 month ago
Am 16.02.26 um 12:15 schrieb Stefan Metzmacher via samba-technical:
> Hi Arnd,
> 
> I'm wondering what the top commit is that you where compiling,
> I guess that's before the 'smb: client: make use of smbdirect.ko'
> commit.
> 
> As we have this at the end of the patchset in ksmbd-for-next:
> 
> fs/smb/common/smbdirect/Kconfig
> 
> config SMB_COMMON_SMBDIRECT
>          def_tristate n
>          depends on INFINIBAND && INFINIBAND_ADDR_TRANS
>          depends on m || INFINIBAND != m
>          select SG_POOL
> 
> I'll try to change the patches to have your hunk
> in the temporary phase in the patchset where we use
> smbdirect_all_c_files, as it's gone at the end of
> the patchset.
> 
> Thanks!
> metze
> 
> Am 16.02.26 um 11:54 schrieb Arnd Bergmann:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The smbdirect code now uses the scatter/gather pool interface. This
>> causes a build failure when the interface is disabled:
>>
>> In file included from fs/smb/client/../common/smbdirect/smbdirect_all_c_files.c:21,
>>                   from fs/smb/client/smbdirect.c:176:
>> fs/smb/client/../common/smbdirect/smbdirect_rw.c: In function 'smbdirect_connection_rw_io_free':
>> fs/smb/client/../common/smbdirect/smbdirect_rw.c:76:9: error: implicit declaration of function 'sg_free_table_chained' [-Wimplicit-function-declaration]
>>     76 |         sg_free_table_chained(&msg->sgt, SG_CHUNK_SIZE);
>>        |         ^~~~~~~~~~~~~~~~~~~~~
>>
>> The other users of this interface all 'select SG_POOL', so so the same
>> here.
>>
>> Fixes: 5ab0987c492e ("smb: smbdirect: introduce smbdirect_rw.c with server rw code")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>   fs/smb/client/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/smb/client/Kconfig b/fs/smb/client/Kconfig
>> index 17bd368574e9..725422b45ef4 100644
>> --- a/fs/smb/client/Kconfig
>> +++ b/fs/smb/client/Kconfig
>> @@ -182,6 +182,7 @@ if CIFS
>>   config CIFS_SMB_DIRECT
>>       bool "SMB Direct support"
>>       depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y
>> +    select SG_POOL

I'm squashing this into the
'smb: client: include smbdirect_all_c_files.c' commit
and the 'smb: client: make use of smbdirect.ko' commit
will remove it again.

metze