[lvm-devel] [PATCH 1/1] Maps fix

Milan Broz mbroz at redhat.com
Wed Sep 29 10:12:38 UTC 2010


On 09/27/2010 05:31 PM, Zdenek Kabelac wrote:
> Read complete content of /proc/self/maps into one buffer without
> realocation in the middle of reading and before doing any m/unlock
> operation with these lines - as some of them gets change.
> With previous implementation we've read some mappings twice ([stack])

ACK, if it solves the problem with lock != unlock size error....

> +		for (len = 0 ; len < _maps_len; len += n) {
> +			if (!(n = read(_maps_fd, _maps_buffer + len, _maps_len - len))) {
> +				_maps_buffer[len] = '0';

typo '\0' :)

for the parsing simple lines it is quite complicated code but if we cannot get
file size from /proc in advance...

Milan




More information about the lvm-devel mailing list