[PATCH 2.4] Fix rlimit check in precheck_file_write()

From: Jason Uhlenkott
Date: Wed Dec 22 2004 - 16:59:16 EST


Remove a broken assumption that rlimits are 32 bits which can cause
nasty things to happen on 64-bit machines if we try to write past the
2^32-1th character of a file and a larger file size limit exists.

Signed-off-by: Jason Uhlenkott <jasonuhl@xxxxxxx>

--- linux-2.4.29-pre3.orig/mm/filemap.c 2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.29-pre3/mm/filemap.c 2004-12-22 13:41:46.000000000 -0800
@@ -3088,9 +3088,9 @@
send_sig(SIGXFSZ, current, 0);
goto out;
}
- if (pos > 0xFFFFFFFFULL || *count > limit - (u32)pos) {
+ if (*count > limit - pos) {
/* send_sig(SIGXFSZ, current, 0); */
- *count = limit - (u32)pos;
+ *count = limit - pos;
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/