Bug 354931

Summary: RFE: better handling of empty /proc/swaps
Product: [Fedora] Fedora Reporter: John Reiser <jreiser>
Component: partedAssignee: Joel Andres Granados <jgranado>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideKeywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-17 08:53:24 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 John Reiser 2007-10-26 21:41:01 UTC
Description of problem: During a fresh install, this sequence of discovering
that there is no swap space is repeated 2395 times:
----- (from strace)
719   open("/proc/swaps", O_RDONLY)     = 14
719   fstat(14, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
719   mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aaac2514000
719   read(14, "Filename\t\t\t\tType\t\tSize\tUsed\tPrio"..., 1024) = 37
719   stat("Filename", 0x7fff3f67cd00)  = -1 ENOENT (No such file or directory)
719   read(14, "", 1024)                = 0
719   close(14)                         = 0
719   munmap(0x2aaac2514000, 4096)      = 0
-----
Instead, the information that there is no swap space should be cached.


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


How reproducible: always


Steps to Reproduce:
1. fresh install from DVD
2. as soon as vtty2 is available during the install:
strace -f -o '|gzip' -q -p <pid-of-anaconda>  > strace.out &
(you must suppy 'strace' on a USB flash memory device before boot, and do the
mount yourself.)
3. inspect strace.out (63MB compressed, 1GB uncompressed) for:
open("/proc/swaps") and stat("Filename").
  
Actual results: 2395 repetitions of discovering that there is no swap space


Expected results: remember after the first time.


Additional info:

Comment 1 Chris Lumens 2008-06-21 16:56:12 UTC
This is parted calling _mount_table_search via _partition_is_mounted_by_dev in
libparted/arch/linux.c over and over again.

Comment 2 Joel Andres Granados 2008-10-17 08:53:24 UTC

*** This bug has been marked as a duplicate of bug 353191 ***