Bug 88000

Summary: swapon called before devlabel in rc.sysinit
Product: [Retired] Red Hat Linux Reporter: David Balažic <david.balazic>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: chris.ricker, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: FC3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-30 18:42:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Balažic 2003-04-04 14:54:09 UTC
Description of problem:

In /etc/rc.d/rc.sysinit , swapon is called before devlabel,
so swapon might try to use the wrong device file, in case the swap device file
is managed by devlabel ( recommended if you change the disk drives a lot )

Line 338 :
action $"Activating swap partitions: " swapon -a -e

Line 501 :
if [ -x /sbin/devlabel ]; then
        /sbin/devlabel restart
fi

Line 662 :
# Now turn on swap in case we swap to files.
swapon -a
action $"Enabling swap space: " /bin/true

The second swapon will "catch" the devlabel managed swap device, but the fisrt
might still try to access a wrong one ( because the symlink has not yet been
updated by devlabel and points to the old, possibly wrong device )

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

initscripts-7.14-1

How reproducible:


Steps to Reproduce:
1. setup a devlabel managed swap device :
  - mkswap /dev/hdxy ( for example hda1 )
  - devlabel add -d /dev/hda1 -s /dev/swap1
( /dev/swap1 is now a symlink to /dev/hda1 )
  - add /dev/swap1 into /etc/fstab
2. make your swap disk change its name ( change from master to slave , or place
on different channel ) , let's assume it was hda before and is hdc now
3. boot
    
Actual results:

The first swapon call will try to use /dev/hda1 ( the symlink still points to it )

Expected results:

devlabel is run before swapon and updates the symlink to point to /dev/hdc1.
swapon has no error.

Additional info:

Comment 1 Bill Nottingham 2005-09-30 18:42:48 UTC
Closing bugs on older, no longer supported, releases. Apologies for any lack of
response.

devlabel has since been deprecated in favor of udev. Therefore, changes to
earlier release code probably won't be made, and I'm closing this.