fix msync error on unmapped area
commit700019f9fea4d78100e0b6032db3a66040620d42
authorHugh Dickins <hugh@veritas.com>
Thu, 4 Jan 2007 20:22:14 +0000 (4 20:22 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Feb 2007 23:49:52 +0000 (23 15:49 -0800)
tree1c45252900c93ec85a206403888bdd7b26e9fb83
parentdbee2bf2f312a9d18fa3f305adc14e2ee58f65df
fix msync error on unmapped area

Fix the 2.6.18 sys_msync to report -ENOMEM correctly when an unmapped area
falls within its range, and not to overshoot: to satisfy LSB 3.1 tests and
to fix Debian Bug#394392.  Took the 2.6.19 sys_msync as starting point
(including its cleanup of repeated "current->mm"s), reintroducing the
msync_interval and balance_dirty_pages_ratelimited_nr needed in 2.6.18.

The misbehaviour fixed here may not seem very serious; but it was enough
to mislead Debian into backporting 2.6.19's dirty page tracking patches,
with attendant mayhem when those resulted in unsuspected file corruption.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/msync.c