Author: dannf
Date: Sun Jan 14 23:11:44 2007
New Revision: 8184

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/proc-swaps-missing-header.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/9
Log:
* Avoid condition where /proc/swaps header may not be printed
  (closes: #292318)

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog        (original)
+++ dists/sid/linux-2.6/debian/changelog        Sun Jan 14 23:11:44 2007
@@ -62,6 +62,8 @@
   * Update unusual_devs entry for ipod to fix an eject issue (closes: #406124)
   * Re-add verify_pmtmr_rate, resolving problems seen on older K6 ASUS
     boards where the ACPI PM timer runs too fast (closes: #394753)
+  * Avoid condition where /proc/swaps header may not be printed
+    (closes: #292318)
 
   [ Norbert Tretkowski ]
   * libata: handle 0xff status properly. (closes: #391867)
@@ -155,7 +157,7 @@
     memory accesses in ehci-hub-control() by adding an alignment attribute
     to the tbuf array declaration. Thanks to David Miller for the patch.
 
- -- dann frazier <[EMAIL PROTECTED]>  Wed, 10 Jan 2007 23:39:47 -0700
+ -- dann frazier <[EMAIL PROTECTED]>  Sun, 14 Jan 2007 15:10:10 -0700
 
 linux-2.6 (2.6.18-8) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/proc-swaps-missing-header.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/proc-swaps-missing-header.patch   
Sun Jan 14 23:11:44 2007
@@ -0,0 +1,74 @@
+From: Suleiman Souhlal <[EMAIL PROTECTED]>
+Date: Thu, 7 Dec 2006 04:32:28 +0000 (-0800)
+Subject: [PATCH] Always print out the header line in /proc/swaps
+X-Git-Tag: v2.6.20-rc1^0~145^2^2~333
+X-Git-Url: 
http://www.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=881e4aabe4c6b3fce93674b67c6adc646fe2683b
+
+[PATCH] Always print out the header line in /proc/swaps
+
+It would be possible for /proc/swaps to not always print out the header:
+
+swapon /dev/hdc2
+swapon /dev/hde2
+swapoff /dev/hdc2
+
+At this point /proc/swaps would not have a header.
+
+Signed-off-by: Suleiman Souhlal <[EMAIL PROTECTED]>
+Cc: Hugh Dickins <[EMAIL PROTECTED]>
+Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
+Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
+---
+
+diff --git a/mm/swapfile.c b/mm/swapfile.c
+index a15def6..8e206ce 100644
+--- a/mm/swapfile.c
++++ b/mm/swapfile.c
+@@ -1274,10 +1274,13 @@ static void *swap_start(struct seq_file *swap, loff_t 
*pos)
+ 
+       mutex_lock(&swapon_mutex);
+ 
++      if (!l)
++              return SEQ_START_TOKEN;
++
+       for (i = 0; i < nr_swapfiles; i++, ptr++) {
+               if (!(ptr->flags & SWP_USED) || !ptr->swap_map)
+                       continue;
+-              if (!l--)
++              if (!--l)
+                       return ptr;
+       }
+ 
+@@ -1286,10 +1289,17 @@ static void *swap_start(struct seq_file *swap, loff_t 
*pos)
+ 
+ static void *swap_next(struct seq_file *swap, void *v, loff_t *pos)
+ {
+-      struct swap_info_struct *ptr = v;
++      struct swap_info_struct *ptr;
+       struct swap_info_struct *endptr = swap_info + nr_swapfiles;
+ 
+-      for (++ptr; ptr < endptr; ptr++) {
++      if (v == SEQ_START_TOKEN)
++              ptr = swap_info;
++      else {
++              ptr = v;
++              ptr++;
++      }
++
++      for (; ptr < endptr; ptr++) {
+               if (!(ptr->flags & SWP_USED) || !ptr->swap_map)
+                       continue;
+               ++*pos;
+@@ -1310,8 +1320,10 @@ static int swap_show(struct seq_file *swap, void *v)
+       struct file *file;
+       int len;
+ 
+-      if (v == swap_info)
+-              seq_puts(swap, 
"Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n");
++      if (ptr == SEQ_START_TOKEN) {
++              seq_puts(swap,"Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n");
++              return 0;
++      }
+ 
+       file = ptr->swap_file;
+       len = seq_path(swap, file->f_vfsmnt, file->f_dentry, " \t\n\\");

Modified: dists/sid/linux-2.6/debian/patches/series/9
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/9 (original)
+++ dists/sid/linux-2.6/debian/patches/series/9 Sun Jan 14 23:11:44 2007
@@ -53,3 +53,4 @@
 + features/arm/ixp4xx-net-driver-improve-mac-handling-0.3.1.patch
 + bugfix/drivers-net-tg3-reset.patch 
 + bugfix/acpi_pm-re-add-verify_mptmr_rate.patch
++ bugfix/proc-swaps-missing-header.patch

_______________________________________________
Kernel-svn-changes mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes

Reply via email to