Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 143118 (IT_52656) - am-utils and autofs use different mtab locking
Summary: am-utils and autofs use different mtab locking
Keywords:
Status: CLOSED ERRATA
Alias: IT_52656
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: am-utils
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Rockai
QA Contact: Jay Turner
URL:
Whiteboard:
: 154108 (view as bug list)
Depends On:
Blocks: 156320 156322
TreeView+ depends on / blocked
 
Reported: 2004-12-16 17:32 UTC by Bastien Nocera
Modified: 2015-01-08 00:09 UTC (History)
10 users (show)

Fixed In Version: RHBA-2005-669
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-05 16:49:46 UTC
Target Upstream Version:


Attachments (Terms of Use)
am-utils-mtab-lock.patch (deleted)
2004-12-16 17:34 UTC, Bastien Nocera
no flags Details | Diff
am-utils-mtab-lock-symlink.patch (deleted)
2004-12-16 17:36 UTC, Bastien Nocera
no flags Details | Diff
Bring the am-utils patches inline with the patch for mount (deleted)
2005-02-24 17:06 UTC, Daniel Berrange
no flags Details | Diff
The am-utils source RPM with all patches applied (deleted)
2005-02-24 17:09 UTC, Daniel Berrange
no flags Details
The correspondingly patched util-linux RPM that i tested (deleted)
2005-02-24 17:11 UTC, Daniel Berrange
no flags Details
Modified berrange@redhat.com testcase. I can acknowledge the testcase works. (deleted)
2005-08-18 15:07 UTC, Peter Vrabec
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:223 qe-ready SHIPPED_LIVE am-utils bug fix update 2005-09-28 04:00:00 UTC
Red Hat Product Errata RHBA-2005:341 qe-ready SHIPPED_LIVE am-utils bug fix update 2005-10-05 04:00:00 UTC
Red Hat Product Errata RHBA-2005:626 qe-ready SHIPPED_LIVE util-linux and mount bug fix update 2005-09-28 04:00:00 UTC
Red Hat Product Errata RHBA-2005:669 qe-ready SHIPPED_LIVE util-linux bug fix update 2005-10-05 04:00:00 UTC

Description Bastien Nocera 2004-12-16 17:32:39 UTC
The BSD automounter in 'am-utils' has hand-crafted its own code for
mounting file systems & updating /etc/mtab. In this code it uses
flock() to take out an exclusive lock on /etc/mtab. The Linux native
automounter (AutoFS4) merely invokes /bin/mount to perform actuall
mount & update /etc/mtab. The /bin/mount program uses fcntl() to take
out an exclusive lock on /etc/mtab.

The result of this is that if you run both AMD and AutoFS4 on the same
machine, then if you happen to be unlucky enough to have a mount point
created / expired in AMD & AutoFS4 managaged locations at the same
time, your /etc/mtab will become corrupted.

Patches below fix this issue.

Comment 1 Bastien Nocera 2004-12-16 17:34:59 UTC
Created attachment 108723 [details]
am-utils-mtab-lock.patch

Patch by Daniel Berrange <berrange@redhat.com>:

I'm attaching a patch which adds a new mtab handling code specifically for
Linux. This is taken from the /bin/mount source code so is 100% in sync with
the locking scheme used there. As an added benefit it also fixes am-utils
handling of symlinks on /etc/mtab (ie it'll not try updating mtab, if it is a
symlink). In terms of impl, the conf/mtab/mtab_linux.c file basically started
off as a copy of conf/mtab/mtab_file.c, and then I merely replaced any code
relating to locking, so the actual updating code didn't change.

Comment 2 Bastien Nocera 2004-12-16 17:36:01 UTC
Created attachment 108724 [details]
am-utils-mtab-lock-symlink.patch

Patch by Daniel Berrange <berrange@redhat.com> again:

The first patch had a bug whereby it was still take out an exclusive lock on
/etc/mtab~ when it was a symlink, even though it would never update it. The
attached patch augments the first, preventing it from doing any locking at all
when symlinks are involved.

Comment 13 Daniel Berrange 2005-02-24 17:06:14 UTC
Created attachment 111384 [details]
Bring the am-utils patches inline with the patch for mount

This patch should be applied after the	am-utils-mtab-lock &
am-utils-mtab-lock-symlink patches. The endd result is to bring am-utils inline
with the locking scheme for /etc/fstab implemented in the patch 111141 for
util-linux

Comment 14 Daniel Berrange 2005-02-24 17:09:40 UTC
Created attachment 111386 [details]
The am-utils source RPM with all patches applied

Comment 15 Daniel Berrange 2005-02-24 17:11:52 UTC
Created attachment 111387 [details]
The correspondingly patched util-linux RPM that i tested

Comment 21 Petr Rockai 2005-03-22 13:58:18 UTC
Uhm, pvrabec fell out of the CC list, apparently. 
 
@pvrabec: i suggest you read the (back)log for the bug and apply the patches 
where appropriate, as kzak suggested. 

Comment 38 Karel Zak 2005-07-28 16:41:46 UTC
*** Bug 154108 has been marked as a duplicate of this bug. ***

Comment 49 Peter Vrabec 2005-08-18 15:07:19 UTC
Created attachment 117871 [details]
Modified berrange@redhat.com testcase. I can  acknowledge the testcase works.

Comment 58 Red Hat Bugzilla 2005-09-28 15:50:37 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-626.html


Comment 59 Red Hat Bugzilla 2005-10-05 13:35:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-341.html


Comment 60 Red Hat Bugzilla 2005-10-05 16:49:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-669.html



Note You need to log in before you can comment on or make changes to this bug.