summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-12-30 00:08:56 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-12-30 00:08:56 +0100
commit146bcbfd39136e15c95e3481a86b870e0c409fb8 (patch)
tree48021c4f44926c6d6ac9b13b9e263676cb8f4e10
parentc9375b6097b9d5e4a3679dfe2ffd2bf034328135 (diff)
ext2fs_large_stores.patch: Fix memory leak
-rw-r--r--debian/changelog6
-rw-r--r--debian/patches/ext2fs_large_stores.patch37
2 files changed, 25 insertions, 18 deletions
diff --git a/debian/changelog b/debian/changelog
index 7dc07457..10dcceda 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+hurd (20111206-2) UNRELEASED; urgency=low
+
+ * patches/ext2fs_large_stores.patch: Fix memory leak, thanks Sergio Lopez!
+
+ -- Samuel Thibault <sthibault@debian.org> Fri, 30 Dec 2011 00:08:04 +0100
+
hurd (20111206-1) unstable; urgency=low
* New upstream snapshot.
diff --git a/debian/patches/ext2fs_large_stores.patch b/debian/patches/ext2fs_large_stores.patch
index 0855f760..75aa6e2e 100644
--- a/debian/patches/ext2fs_large_stores.patch
+++ b/debian/patches/ext2fs_large_stores.patch
@@ -1949,31 +1949,32 @@ Support for >2GB volumes
_pager_block_termination (p); /* until we are done with the pagemap
when the write completes. */
-@@ -90,6 +93,23 @@ _pager_do_write_request (mach_port_t obj
+@@ -90,6 +93,24 @@ _pager_do_write_request (mach_port_t obj
pm_entries = &p->pagemap[offset / __vm_page_size];
-+ if (! dirty && ! kcopy)
-+ {
-+ /* Prepare notified array. */
-+ for (i = 0; i < npages; i++)
-+ notified[i] = (p->notify_on_evict
-+ && ! (pm_entries[i] & PM_PAGEINWAIT));
-+
-+ _pager_release_seqno (p, seqno);
-+ goto notify;
-+ }
-+
+ if (! dirty)
+ {
-+ _pager_allow_termination (p);
-+ goto release_out;
++ munmap ((caddr_t) data, length);
++ if (!kcopy) {
++ /* Prepare notified array. */
++ for (i = 0; i < npages; i++)
++ notified[i] = (p->notify_on_evict
++ && ! (pm_entries[i] & PM_PAGEINWAIT));
++
++ _pager_release_seqno (p, seqno);
++ goto notify;
++ }
++ else {
++ _pager_allow_termination (p);
++ goto release_out;
++ }
+ }
+
/* Make sure there are no other in-progress writes for any of these
pages before we begin. This imposes a little more serialization
than we really have to require (because *all* future writes on
-@@ -120,10 +140,6 @@ _pager_do_write_request (mach_port_t obj
+@@ -120,10 +141,6 @@ _pager_do_write_request (mach_port_t obj
for (i = 0; i < npages; i++)
pm_entries[i] |= PM_PAGINGOUT | PM_INIT;
@@ -1984,7 +1985,7 @@ Support for >2GB volumes
/* If this write occurs while a lock is pending, record
it. We have to keep this list because a lock request
might come in while we do the I/O; in that case there
-@@ -163,7 +179,10 @@ _pager_do_write_request (mach_port_t obj
+@@ -163,7 +180,10 @@ _pager_do_write_request (mach_port_t obj
for (i = 0; i < npages; i++)
{
if (omitdata & (1 << i))
@@ -1996,7 +1997,7 @@ Support for >2GB volumes
if (pm_entries[i] & PM_WRITEWAIT)
wakeup = 1;
-@@ -179,14 +198,22 @@ _pager_do_write_request (mach_port_t obj
+@@ -179,14 +199,22 @@ _pager_do_write_request (mach_port_t obj
pm_entries[i] |= PM_INVALID;
if (pm_entries[i] & PM_PAGEINWAIT)
@@ -2026,7 +2027,7 @@ Support for >2GB volumes
pm_entries[i] &= ~(PM_PAGINGOUT | PM_PAGEINWAIT | PM_WRITEWAIT);
}
-@@ -198,10 +225,29 @@ _pager_do_write_request (mach_port_t obj
+@@ -198,10 +226,29 @@ _pager_do_write_request (mach_port_t obj
if (wakeup)
condition_broadcast (&p->wakeup);