[Samba] libgpfs.so

Christof Schmitt cs at samba.org
Thu Apr 13 16:08:28 UTC 2023


On Thu, Apr 13, 2023 at 02:29:22PM +0300, Michael Tokarev via samba wrote:
> I'm trying to debug a phantom I/O error which I mentioned before
> (https://lists.samba.org/archive/samba/2023-March/244431.html -
> it turned out it has nothing to do with kernel oplocks).
> 
> And noticed samba is regularly tries to load libgpfs.so.
> 
> This is done in gpfswrap_init() in lib/util/gpfswrap.c, which
> is used in vfs_gpfs.c (understandable) *and* in lib/util/debug.c.
> The latter added by
> 
> commit f9e92fc2b0dc4e5c613cf795952e3484f50388ac
> Author: Christof Schmitt <cs at samba.org>
> Date:   Thu Feb 19 16:32:44 2015 -0700
> 
>     debug: Add GPFS tracing backend
> 
> 
> Curious why samba is constantly trying to load this lib,
> unconditionally.. is it really needed? What does GPFS do
> for debugging?

If GPFS is running on the Samba system, there is also the option to have
Samba issue log and trace message to GPFS. This can help troubleshooting
issues that are caused by the interaction of Samba and GPFS by having
traces from both components in one place.

With the current way the GPFS API is implemented, Samba tries to load
the corresponding library at run-time. Looking at the code, we could
limit this to instances where the gpfs logging backend is enabled:

diff --git a/lib/util/debug.c b/lib/util/debug.c
index 95de5ce3595..b83075cb239 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -406,7 +406,9 @@ static void debug_lttng_log(int msg_level, const char *msg, size_t msg_len)
 static void debug_gpfs_reload(bool enabled, bool previously_enabled,
                              const char *prog_name, char *option)
 {
-       gpfswrap_init();
+       if (enabled) {
+               gpfswrap_init();
+       }
 
        if (enabled && !previously_enabled) {
                gpfswrap_init_trace();

Regards,

Christof



More information about the samba mailing list