Bug 4975 - DMAPI for GPFS on linux doesn't report offline media
Summary: DMAPI for GPFS on linux doesn't report offline media
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.25c
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2007-09-14 07:12 UTC by Jonathan Barber
Modified: 2013-01-11 15:17 UTC (History)
2 users (show)

See Also:


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:

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.

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



        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:

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