Bug 4975 - DMAPI for GPFS on linux doesn't report offline media
DMAPI for GPFS on linux doesn't report offline media
Status: RESOLVED LATER
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.25c
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-14 07:12 UTC by Jonathan Barber
Modified: 2013-01-11 15:17 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Barber 2007-09-14 07:12:25 UTC
DMAPI for GPFS 2.3.0-24 on Linux (RHEL4) doesn't report offline media.

Compliled smbd from source. Set debuglevel for smbd to dmapi:10, logs show the following when accessing a directory on a share with "dmapi support = yes":

[2007/09/14 12:48:52, 10] smbd/dmapi.c:dmapi_file_flags(256)
  dm_path_to_handle(./SWMtubEB1-9_R3D.dv.log): Operation not permitted

According to the GPFS DMAPI API docs:
http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs.doc/gpfs23/bl1dmp10/bl1dmp1034.html

this is because any GPFS DMAPI calls will fail with ENOPERM if you're not root.

Applying the following patch:
--- ./smbd/dmapi.c.orig 2007-09-14 12:49:38.000000000 +0100
+++ ./smbd/dmapi.c      2007-09-14 12:49:53.000000000 +0100
@@ -245,9 +245,7 @@
        /* AIX has DMAPI but no POSIX capablities support. In this case,
         * we need to be root to do DMAPI manipulations.
         */
-#ifndef HAVE_POSIX_CAPABILITIES
        become_root();
-#endif

        err = dm_path_to_handle(CONST_DISCARD(char *, path),
                &dm_handle, &dm_handle_len);
@@ -305,9 +303,7 @@

 done:

-#ifndef HAVE_POSIX_CAPABILITIES
        unbecome_root();
-#endif

        return flags;
 }

allows smbd to get further, but it then fails with:
[2007/09/14 12:53:46, 10] smbd/dmapi.c:dmapi_file_flags(283)
  dm_get_eventlist(./SWMtubEB1-9_R3D.dv.log): Invalid argument

Refering to the docs again:
http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.gpfs.doc/gpfs23/bl1dmp10/bl1dmp1043.html

Suggests that EINVAL is because the handle is not valid. But I've tried placing a call before dm_get_eventlist() to dm_handle_is_valid(), which returns true.

I can't see why dm_get_eventlist() is failing and I've just exhausted my meagre store of DMAPI knowledge.
Comment 1 Christian Ambach 2013-01-11 15:17:37 UTC
DMAPI is not needed any more with Samba 3.6 and the gpfs:hsm option which will look at the OFFLINE bit in GPFS instead of the slow DMAPI path