Bug 102929 - rpm hangs with stale nfs mount point
rpm hangs with stale nfs mount point
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-08-22 14:42 EDT by James Martin
Modified: 2007-04-18 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-08-25 11:57:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description James Martin 2003-08-22 14:42:12 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030728
Mozilla Firebird/0.6.1

Description of problem:
I noticed rpm was hanging when I tried to remove some packages with the standard
rpm -e <packagename>.

I did an strace rpm -e <packagename> and found this:

read(4, "/dev/hda6 / ext3 rw 0 0\nnone /pr"..., 4096) = 314
stat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
stat64("/proc/bus/usb", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
stat64("/boot", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
stat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/dev/pts", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat64("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) = 0
stat64("/mnt/fat", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0

as you can see, it is hanging on the /mnt/nfs..  It's been like this for the
past 5 minutes (still is while I'm writing this bug report).

If I unmount it works fine.  I guess the question is why is rpm -e reading my
mount points, and 2ndly, why is it hanging on a stale NFS mountpoint?  Maybe you
guys need to put a timeout feature on the function that checks all the mount points?

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Mount a nfs directory.
2.  Make it stale.
3.  Attempt to rpm -e a package.

Actual Results:  rpm hangs indefinitely.

Expected Results:  The package should be removed.

Additional info:

my rpm is rpm-4.2-0.69.
Comment 1 Michael Lee Yohe 2003-08-22 16:57:06 EDT
I have this same problem with smbfs file systems.
Comment 2 Jeff Johnson 2003-08-25 11:57:25 EDT

In order to do disk space checks, rpm needs to know the
size of all mounted file systems.

This is done with statvfs, which also does a stat on each mount

If/when the stat blocks, then rpm hangs.
Comment 3 James Martin 2003-08-25 12:34:03 EDT
Ok.. so what you are saying is that this is a bug in stat?  Shouldn't rpm be
smart enough to know if stat is taking too long to either die and report an
error or skip that mounted filesystem altogether?  If I were to write a patch
for rpm or stat, where would I be looking?
Comment 4 Jeff Johnson 2003-08-25 12:39:43 EDT
No, stat is behaving exactly as it should.

The problem (I'm told, iirc) is in the statvfs implementation
in glibc, which walks and stats every entry in /etc/mtab
even though statvfs was called with single mount point.

Easiest by far is to add --ignoresize when invoking and skip
the stal nfs (or smbfs) mount.
Comment 5 Jeff Johnson 2003-08-25 17:57:29 EDT
Try again, #packaging and/or #fedora, usually after 7pm EDT
Comment 6 Jeff Johnson 2003-08-26 15:37:59 EDT
Try again, #packaging and/or #fedora, usually after 7pm EDT

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