[Dovecot] Small problem with src/lib/mountpoint.c [now with patch attached!]
pmb1 at york.ac.uk
Wed Jul 18 13:04:57 EEST 2007
Hi Timo, et al -
On 17 Jul 2007, at 18:12, Timo Sirainen wrote:
> On 17.7.2007, at 13.55, Mike Brudenell wrote:
>> auto_direct /mailstore/messages/p autofs
>> direct,ignore,dev=4740014 1184648400
>> crypt2.york.ac.uk:/vol/vol9/p /mailstore/messages/p nfs
>> proto=tcp,xattr,dev=4700386 1184668792
>> Although there are two entries they have different device
>> numbers. The mountpoint_get() function attempts to guard against
>> this by checking the device number obtained matches that of the
>> path being located.
> What do you mean different device numbers? Both have the same mount
> path, so how can they be different?
I'm afraid I don't understand the innards of the automounter. All I
can say is what I see...
We use the automounter extensively as it gives central management for
shares and saves having to edit /etc/vfstab files on umpteen machines
all over the place.
A host making use of the automounter has entries in the /etc/mnttab
for all the filestores available to it TO BE mounted, even when they
AREN'T ACTUALLY mounted at the moment.
When something access a file or directory in the filestore the
automounter leaps in and furtively mounts the filestore before the
granting the access. This results in a SECOND entry for that
filestore in the /etc/mnttab file, and has the same mount point as
the first entry.
The two entries have different "dev=NNNNN" values in their options
fields to distinguish them. The thing I find confusing/surprising is
1. When I visually inspect the contents of /etc/mnttab the two
/mailstore/messages/p have DIFFERENT "dev=NNNNN" entries, but
2. When I put debug logging into Dovecot's loop that iterates
/etc/mnttab entries using getmntent() both entries come through
SAME "dev=NNNNN" value ... the first (autofs) entry is returned
device number from the second (real) mount's entry in the file.
If the different (unique) device numbers were being yielded by
then there wouldn't be a problem: Dovecot is checking these and
skip the first (autofs) entry as the number was wrong.
I'll do some testing using a minimal test program to check this
The Computing Service, University of York, Heslington, York Yo10 5DD, UK
* Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
More information about the dovecot