Mailing List Archive

Re: heartbeat/nfsserver: is_bound function no longer works
Hi,

I suggest the following patch:

is_bound ()
{
b=`basename $1`
grep -q " /$b $2 " < /proc/self/mountinfo
return $?
}

Cheers,
Eberhard

> On Thu, 9 Feb 2012 16:51:29 +0100, Dejan Muhamedagic wrote:
>
> Hi,
>
> On Thu, Feb 09, 2012 at 01:41:33PM +0100, Eberhard Kuemmerle wrote:
>> Hi,
>>
>> my nfsserver resource is configured like that:
>>
>> primitive nfs ocf:heartbeat:nfsserver \
>> params nfs_shared_infodir="/server/nfs_infodir"
>>
>> With older kernels, the bind mount produced by ocf:heartbeat:nfsserver
>> and the mount of the base filesystem looked like that in /etc/mtab:
>>
>> /dev/mapper/server on /server type ext4
>> (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
>> /server/nfs_infodir on /var/lib/nfs type none ...
>>
>> and the is_bound function in ocf:heartbeat:nfsserver worked fine.
>> But with newer kernels (now I use Opensuse 12.1, kernel 3.1.9) the
>> mounts look like that:
>>
>> /dev/mapper/server on /server type ext4
>> (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
>> /dev/mapper/server on /var/lib/nfs type ext4
>> (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
>>
>> and the is_bound function cannot identify it's mount.
> So, the mount format changed. Is that caused by the new kernel
> version or the new version of the mount command?
>
>> More information can be found in /proc/self/mountinfo:
>>
>> / /server rw,relatime - ext4 /dev/mapper/server
>> rw,user_xattr,acl,barrier=1,data=ordered
>> /nfs_infodir /var/lib/nfs rw,relatime - ext4 /dev/mapper/server
>> rw,user_xattr,acl,barrier=1,data=ordered
>>
>> Here, it is visible that only the subdirectory nfs_infodir is mounted on
>> /var/lib/nfs.
>> Perhaps, that information should be used in is_bound.
> Yes, looks like that should be safe to do.
>
> Anybody with a patch?
>
> Cheers,
>
> Dejan
>
> P.S. Moving the discussion to linux-ha-dev.
>
>> Regards,
>> Eberhard

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

Kennen Sie schon unseren neuen Film? http://www.fz-juelich.de/film
Kennen Sie schon unsere app? http://www.fz-juelich.de/app
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/