Messages in this thread Patch in this message | | | Date | Thu, 27 Mar 2003 17:33:43 +0000 (GMT) | From | Hugh Dickins <> | Subject | wonderffffffffull ac filemap patch |
| |
Here's a patch I've stolen from 2.4-ac, which is clearly correct so far as it goes. I keep wanting to get this integrated into 2.4 and 2.5, then bring shmem.c into line (in 2.5 use generic_write_checks).
But each time I approach it, I get stuck on trying to understand the code it's a good patch to. I understand that there's a problem with loff_t twice as wide as rlim, and that we need to trim count down near the limit. But I don't understand why 0xFFFFFFFFULL and (u32) rather than RLIM_INFINITY and (unsigned long): are we really trying to cripple 64-bit arches here?
Hugh
--- 2.5.66-mm1/mm/filemap.c Wed Mar 26 11:50:36 2003 +++ linux/mm/filemap.c Thu Mar 27 16:53:46 2003 @@ -1509,7 +1509,10 @@ send_sig(SIGXFSZ, current, 0); return -EFBIG; } - if (*pos > 0xFFFFFFFFULL || *count > limit-(u32)*pos) { + /* Fix this up when we got to rlimit64 */ + if (*pos > 0xFFFFFFFFULL) + *count = 0; + else if (*count > limit - (u32)*pos) { /* send_sig(SIGXFSZ, current, 0); */ *count = limit - (u32)*pos; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |