[DRBD-user] drbd 8.0pre5 Lower device is already mounted

Philipp Reisner philipp.reisner at linbit.com
Mon Oct 2 17:40:48 CEST 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Am Montag, 2. Oktober 2006 17:10 schrieb Ralf Schenk:
> Philipp Reisner schrieb:
> > Am Montag, 2. Oktober 2006 15:53 schrieb Ralf Schenk:
> >> Philipp Reisner schrieb:
> >>> Could you please retry with this pach:
> >>>
> >>> phil at mescal:~/src/drbd08/drbd$ svn diff
> >>> Index: drbd_nl.c
> >>> ===================================================================
> >>> --- drbd_nl.c   (revision 2482)
> >>> +++ drbd_nl.c   (working copy)
> >>> @@ -671,6 +671,8 @@
> >>>
> >>>         nbc->backing_bdev = inode->i_bdev;
> >>>         if (bd_claim(nbc->backing_bdev, mdev)) {
> >>> +               WARN("Backing device hold by: %s\n",
> >>> +                    nbc->backing_bdev->bd_holder);
> >>>                 retcode=LDMounted;
> >>>                 goto fail;
> >>>         }
> >>>
> >>>
> >>> And see what ends up in the kernel log ?
> >>
> >> Hello !
> >>
> >> Thanks for your fast reply...
> >> Thats what I get now:
> >> Oct  2 15:42:27 xeon2 kernel: drbd: initialised. Version: 8.0pre5
> >> (api:84/proto:83)
> >> Oct  2 15:42:27 xeon2 kernel: drbd: SVN Revision: 2482M build by
> >> root at ubuntu_devel, 2006-10-02 15:38:45
> >> Oct  2 15:42:27 xeon2 kernel: drbd: registered as block device major 147
> >> Oct  2 15:43:05 xeon2 kernel: drbd0: Backing device hold by:
> >> Oct  2 15:43:05 xeon2 kernel: drbd0: conn( StandAlone -> Unconnected )
> >> Oct  2 15:43:05 xeon2 kernel: drbd0: receiver (re)started
> >> Oct  2 15:43:05 xeon2 kernel: drbd0: conn( Unconnected -> WFConnection )
> >>
> >> No answers here....
> >>
> >> But perhaps that helps:
> >> Ubuntu (6.06 Dapper Server) uses evms as addon for logical volume
> >> management. They use a kernel patch to make that work with later 2.6
> >> kernels. Since I built my kernel on my own but wanted to stay with that
> >> functionality I applied their kernel-patch manually. Perhaps that
> >> conflicts with your way of checking if a device is already in use...
> >>
> >> I attach the small patch.
> >
> > It seems that something else has already claimed that block device.
> > Strange. Can you mkfs and mount that device ?
>
> Yes, of course. It already contains a file system and a whole virtual
> server which is not in production. I was reading the bd_claim kernel
> function modified by the ubuntu patch to see if the results are the
> problem. I'm not a c programmer...
>
> But I think your code
>         if (bd_claim(nbc->backing_bdev, mdev)) {
>                 WARN("Backing device hold by: %s\n",
>                     nbc->backing_bdev->bd_holder);
>                 retcode=LDMounted;
>                 goto fail;
>         }
>
> gets back -EBUSY all the time but nbc->backing_bdev->bd_holder is empty.

I do not think so ;)

When I read your ubuntu patch it boils down to that bd_claim() is in
your kernel:

int bd_claim(struct block_device *bdev, void *holder)
{
        int res = -EBUSY;
        spin_lock(&bdev_lock);

        if (!bdev->bd_holder || bdev->bd_holder == holder) {
                bdev->bd_holder = holder;
                bdev->bd_holders++;
                res = 0;
        }
        spin_unlock(&bdev_lock);
        return res;
}

if nbc->backing_bdev->bd_holder == 0 then it will return 0. => drbd claimed
the devices sucessfully, or it will return -EBUSY => someone else claimed it
already.

Retry it with 
                    WARN("Backing device hold by: %p\n",
                    nbc->backing_bdev->bd_holder);

note the "%p" instad of "%s".

-phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :



More information about the drbd-user mailing list