[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#292318: kernel-image-2.6.10-1-686: Disappearing header line in /proc/swaps

Package: kernel-image-2.6.10-1-686
Version: 2.6.10-3
Severity: minor

The file /proc/swaps normally contains a header line reading something


at least that's how it appears to be generated in mm/swapfile.c.  I just
had a situation where this header line went missing, breaking dynswap (a
dynamic swap manager designed to replace swapd).

The scenario went as follows.  In the /proc/swaps dumps I trimmed some
whitespace for legibility and line length.

 - started out with a swapless system (with /proc/swaps completely empty)
 - added n swap files (with swapon(file, 0))
 - removed the most recent n-2 swapfiles in LIFO order (using swapoff())
 - removed the original swapfile
 - left with only the second swapfile, /proc/swaps now read:

/var/tmp/dynswap/2             file            320544  10112   -2

 - note missing header line!
 - after "swapoff /var/tmp/dynswap/2", /proc/swaps was (properly) empty
 - then, after "swapon /var/tmp/dynswap/2", it was back to normal:

Filename                       Type            Size    Used
Priority/var/tmp/dynswap/2     file            320544  0       -18

I can reproduce the scenario with a minimum of 3 swapfiles, i.e. n=3:
 - swapon 1
 - swapon 2
 - swapon 3
 - swapoff 3
 - swapoff 1
 - cat /proc/swaps -> missing header!

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages kernel-image-2.6.10-1-686 depends on:
ii  coreutils [fileutils]         5.2.1-2    The GNU core utilities
ii  initrd-tools                  0.1.76     tools to create initrd image
for p
ii  module-init-tools             3.1-rel-2  tools for managing Linux
kernel mo

-- no debconf information

Reply to: