Bug 57314 - netfs init script has errors
netfs init script has errors
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-10 02:38 EST by Zenon Mousmoulas
Modified: 2014-03-16 22:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-12-10 14:59:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch against netfs init script from initscripts-6.40-1: fixes possible errors when unmounting _netdev and other filesystems (1.05 KB, patch)
2001-12-10 02:44 EST, Zenon Mousmoulas
no flags Details | Diff
patch against netfs init script from initscripts-6.40-1, version 2: fixes errors when unmounting filesystems on loop devices and filesystems mounted with the _netdev option (2.02 KB, patch)
2001-12-10 13:48 EST, Zenon Mousmoulas
no flags Details | Diff

  None (edit)
Description Zenon Mousmoulas 2001-12-10 02:38:06 EST
Description of Problem:
The netfs init script has some errors that could stop it from functioning 
properly. More specifically:

line 28:
NETDEVMTAB=`grep -v '^#' /proc/mounts | awk '{ if (($4 ~ /_netdev$/) && 
($2 != "/")) print $2}'`
I am not sure if this is a problem but the patterm '/_netdev$/' in the 
awk program assumes that _netdev will only be found if it is at the end 
of the 4th field (mount options) in /proc/mounts. In another similar awk 
program later in the script (line 82) there is once again the 
pattern '/_netdev/'. In that case, it doesn't have to be at the end of 
the field. I suggest that '$' is removed from the pattern (see the 
proposed patch below).

line 74:
while [ -n "$remaining" -a "$retry" -gt 0 ]
This loop occurs in the context of: '[ -n "$NETDEVMTAB" ] && { ... }' 
(line 71-89). In this case there is an error that may prevent network 
block filesystems (mounted with the _netdev option) to be properly 
unmounted. The problem is that the variable $remaining is not set before 
the loop starts, unlike with loop devices (line 48) and NFS filesystems 
(line 93) where it is set before a similar 'while' loop begins. As a 
result, if this variable is not set previously, the loop will never be 
executed because $remaining is null and the '-n "$remaining"' condition 
is not met. I suggest the variable should be assigned before the 
execution of this loop. See the proposed patch.

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

How Reproducible:

Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:
Comment 1 Zenon Mousmoulas 2001-12-10 02:44:22 EST
Created attachment 40247 [details]
patch against netfs init script from initscripts-6.40-1: fixes possible errors when unmounting _netdev and other filesystems
Comment 2 Zenon Mousmoulas 2001-12-10 13:45:49 EST
I have updated the patch to include a fix suggested by avi@argo.co.il (see Bug 
#57283) that takes care of loop devices not being unmounted properly when 
executing 'service netfs stop'.
Comment 3 Zenon Mousmoulas 2001-12-10 13:48:38 EST
Created attachment 40307 [details]
patch against netfs init script from initscripts-6.40-1, version 2: fixes errors when unmounting filesystems on loop devices and filesystems mounted with the _netdev option
Comment 4 Zenon Mousmoulas 2001-12-10 14:59:16 EST
It looks like in RawHide (initscripts-6.40.2-1) the problem that was reported 
by avi@argo.co.il in Bug #57283 is addressed. A different approach is used, 
however the problem seems to be solved. So the proposed fix (which I have 
included in my second patch) is probably not needed anymore.

Therefore please ignore the second patch I submitted and only consider the 
first one; the problem with fs mounted with option_netdev and $remaining is 
still there, even in the RawHide rpm.
Comment 5 Bill Nottingham 2002-01-25 01:35:59 EST
Applied in 6.51-1, thanks!

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