lkml.org 
[lkml]   [2001]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bug in /proc/lvm/global (garbage printed)
On Nov 10, 2001  12:06 +0100, Thorsten Kukuk wrote:
> The problem is in the _proc_read_global function. This function does
> not use the "page" parameter to return the data. Instead it allocates
> it's own buffer and change to "start" parameter to point to it.
>
> --- drivers/md/lvm-fs.c 2001/11/09 19:00:38 1.1
> +++ drivers/md/lvm-fs.c 2001/11/09 20:50:16
> @@ -482,11 +480,15 @@
> buf = NULL;
> return 0;
> }
> - *start = &buf[pos];
> - if (sz - pos < count)
> + /* *start = &buf[pos]; */
> + if (sz - pos < count) {
> + memcpy (page, &buf[pos], sz - pos);
> return sz - pos;
> - else
> + }
> + else {
> + memcpy (page, &buf[pos], count);
> return count;
> + }
>
> #undef LVM_PROC_BUF
> }

What version of LVM do you have? This code looks different than mine.
The file lvm-fs.c does not exist in Linus kernels, only in patched kernels.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.039 / U:4.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site