filejournal: parse kernel version 3.0+

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-07-08 14:15:56 -07:00
parent 3f708ee554
commit bae40eaa96

View File

@ -169,10 +169,13 @@ static int get_kernel_version(int *a, int *b, int *c)
}
if (sscanf(buf, "Linux version %d.%d.%d", a, b, c) != 3) {
derr << "get_kernel_version: failed to parse string: '"
<< buf << "'" << dendl;
ret = EIO;
goto close_fd;
if (sscanf(buf, "Linux version %d.%d", a, b) != 2) {
derr << "get_kernel_version: failed to parse string: '"
<< buf << "'" << dendl;
ret = EIO;
goto close_fd;
}
*c = 0;
}
dout(0) << " kernel version is " << *a <<"." << *b << "." << *c << dendl;