Messages in this thread | | | Date | Thu, 3 Jun 2004 09:38:07 -0700 | From | Paul Jackson <> | Subject | Re: [PATCH] fix sys cpumap for > 352 NR_CPUS |
| |
> We do check for an error in that function, so returning any negative > error value for a show() sysfs callback will be handled properly.
If a show() function returns an error, you handle it - good. As it should be.
But if a show() function overwrites the page buffer provided to it, before returning, then there is nothing you can do beyond sending condolences to the next of kin.
This PATCH and email thread came about because the buffer size is not passed into the show() function, nor, so far as I can tell, is it documented anywhere other than implicitly in the fill_read_buffer() code:
buffer->page = (char *) get_zeroed_page(GFP_KERNEL);
So we were getting confused as to what size buffer we had, when coding defensively to avoid buffer overrun.
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.650.933.1373 - 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/
| |