Skip to contentSkip to conversation

2.6.9-mm1: LVM stopped working

DISCUSSION Laurent Riffard 1 participant 2 messages Nov 1, 2004 – Nov 3, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

Lvm2 stopped working since 2.6.9-mm1 for me too : 2.6.9-rc4-mm1 was fine, 2.6.9-mm1 to 2.6.10-mm2 break lvm2. Reverting dio-handle-eof.patch on these kernel solves the problem.

I have a simple test case here.

With 2.6.9-rc4-mm1, "pvdisplay /dev/hda4" shows :
--- Physical volume ---

PV Name               /dev/hda4
VG Name               vglinux1
PV Size               19,07 GB / not usable 0
Allocatable           yes
PE Size (KByte)       4096
Total PE              4882
Free PE               3424
Allocated PE          1458
PV UUID               Kvi5oA-d8NL-DU0n-vJpt-TKb3-RmDP-nrZoaz

With later -mm kernel, "pvdisplay /dev/hda4" shows :
No physical volume label read from /dev/hda4 Failed to read physical volume "/dev/hda4"

I tracked down the problem to this code section in fs/direct-io.c (function direct_io_worker) :

1012 dio->total_pages = 0;
1013 if (user_addr & (PAGE_SIZE-1)) {
1014 dio->total_pages++;
1015 bytes -= PAGE_SIZE - (user_addr & (PAGE_SIZE - 1));

 1016                 }
 1017                 dio->total_pages += (bytes + PAGE_SIZE - 1) / PAGE_SIZE;
 1018                 dio->curr_user_address = user_addr;

1019
1020 ret = do_direct_IO(dio);
1021
1022 dio->result += bytes -
1023 ((dio->final_block_in_request - dio->block_in_file) <<
1024 blkbits);

In my case, direct_io_worker is called to read 2048 bytes at the beginning of /dev/hda4 :
user_addr=0xbfff9800 (half page aligned)
bytes=2048 (half page)
So "bytes" is zeroed line 1015.
And dio->result is zeroed line 1023.
As a result, direct_io_worker returns 0.

Before dio-handle-eof.patch, line 1022 was :

	dio->result += iov[seg].iov_len -

What is the semantic of "bytes" line 1015 : bytes to read on the next page ? Did I miss something ?

hope this helps... I will do some tests if needed.

Signature · 1 line
laurent
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I applied the following patch [http://lkml.org/lkml/2004/11/2/129]
from Jens Axboe onto kernel 2.6.10-rc1-mm2 (succeeded with offset 2 lines) and it solved the problem.

Thanks.

BTW, is there a mean to reply to a post in lkml witout being subscribed ?
- --
laurent

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBiAr6UqUFrirTu6IRAh8OAKC3bMrwHy8BFxOoEhg03VbQp9R5hACgu5pn ZWguH7/6uODFa8NuhwinreQ=
=qXXZ
-----END PGP SIGNATURE-----