Skip to contentSkip to conversation

2.6.6 is crashing repeatedly

DISCUSSION [email protected] 4 participants 8 messages May 22, 2004 – May 28, 2004 NFS server

lore
Share & tools
lore
#0 lore raw

I already reported (I thought) this message:

May 19 02:23:47: Unable to handle kernel paging request at virtual address efd78000
May 19 02:23:47:  printing eip:
May 19 02:23:47: c01a999b
May 19 02:23:47: *pde = 004a7067
May 19 02:23:47: *pte = 2fd78000
May 19 02:23:47: Oops: 0002 [#1]
May 19 02:23:47: DEBUG_PAGEALLOC
May 19 02:23:47: CPU:    0
May 19 02:23:47: EIP:    0060:[<c01a999b>]    Not tainted
May 19 02:23:47: EFLAGS: 00010246   (2.6.6) 
May 19 02:23:47: EIP is at encode_entry+0x4b/0x530
May 19 02:23:47: eax: 00000000   ebx: 00000000   ecx: 00000644   edx: f3532df8
May 19 02:23:47: esi: efd78000   edi: e4a19644   ebp: 00000654   esp: f14b7b98
May 19 02:23:47: ds: 007b   es: 007b   ss: 0068
May 19 02:23:47: Process nfsd (pid: 1029, threadinfo=f14b6000 task=f1532a80)
May 19 02:23:47: Stack: 00000008 0000002f f5217080 00000027 00000000 f5217084 f3532df8 00000006 
May 19 02:23:47:        e4a1964c 0000001c 02000001 04000900 0019a291 0022e7a8 14343bfc 0022e76b 
May 19 02:23:47:        14343b61 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
May 19 02:23:47: Call Trace:
May 19 02:23:47:  [<c016af1f>] ext3_bread+0x1f/0x90
May 19 02:23:47:  [<c0168505>] ext3_readdir+0x305/0x490
May 19 02:23:47:  [<c011dd18>] in_group_p+0x38/0x70
May 19 02:23:47:  [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
May 19 02:23:47:  [<c019d930>] fh_verify+0x280/0x550
May 19 02:23:47:  [<c019d5d0>] nfsd_acceptable+0x0/0xe0
May 19 02:23:47:  [<c013da8c>] open_private_file+0x1c/0x90
May 19 02:23:47:  [<c014ba2d>] vfs_readdir+0x7d/0x90
May 19 02:23:47:  [<c01a11f9>] nfsd_readdir+0x79/0xc0
May 19 02:23:47:  [<c01a6b8a>] nfsd3_proc_readdirplus+0xda/0x1d0
May 19 02:23:47:  [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
May 19 02:23:47:  [<c01a8e90>] nfs3svc_decode_readdirplusargs+0x0/0x180
May 19 02:23:47:  [<c019bce6>] nfsd_dispatch+0xb6/0x1a0
May 19 02:23:47:  [<c03139fd>] svc_authenticate+0x4d/0x80
May 19 02:23:47:  [<c03112d7>] svc_process+0x487/0x5f0
May 19 02:23:47:  [<c0103b6c>] common_interrupt+0x18/0x20
May 19 02:23:47:  [<c019bad9>] nfsd+0x179/0x2d0
May 19 02:23:47:  [<c019b960>] nfsd+0x0/0x2d0
May 19 02:23:47:  [<c0101fbd>] kernel_thread_helper+0x5/0x18
May 19 02:23:47: 
May 19 02:23:47: Code: 89 06 89 c8 0f c8 89 46 04 81 7c 24 1c 00 01 00 00 b8 ff 00 

Which later turned into a reboot-requiring cascade of these:

May 19 06:29:57:  <4>qmail-rspawn: page allocation failure. order:0, mode:0x20
May 19 06:29:57: Call Trace:
May 19 06:29:57:  [<c0127395>] __alloc_pages+0x2d5/0x330
May 19 06:29:57:  [<c012740f>] __get_free_pages+0x1f/0x40
May 19 06:29:57:  [<c012a961>] cache_grow+0x91/0x270
May 19 06:29:57:  [<c012ae3e>] cache_alloc_refill+0x2fe/0x400
May 19 06:29:57:  [<c01261a7>] mempool_alloc+0x67/0x110
May 19 06:29:57:  [<c012b520>] kmem_cache_alloc+0x1a0/0x1b0
May 19 06:29:57:  [<c020dad8>] submit_bio+0x58/0xf0
May 19 06:29:57:  [<c01d1490>] radix_tree_node_alloc+0x10/0x50
May 19 06:29:57:  [<c01d16f9>] radix_tree_insert+0xe9/0x110
May 19 06:29:57:  [<c0138a25>] __add_to_swap_cache+0x55/0xc0
May 19 06:29:57:  [<c0138bbe>] add_to_swap+0x4e/0xb0
May 19 06:29:57:  [<c012deef>] shrink_list+0x3af/0x3e0
May 19 06:29:57:  [<c012e065>] shrink_cache+0x145/0x300
May 19 06:29:57:  [<c012e7a9>] shrink_caches+0x79/0x80
May 19 06:29:57:  [<c012e851>] try_to_free_pages+0xa1/0x180
May 19 06:29:57:  [<c012728c>] __alloc_pages+0x1cc/0x330
May 19 06:29:57:  [<c014515e>] <4>qmail-rspawn: page allocation failure. order:0, mode:0x20
May 19 06:29:57: Call Trace:
May 19 06:29:57:  [<c0127395>] __alloc_pages+0x2d5/0x330
May 19 06:29:57:  [<c012740f>] __get_free_pages+0x1f/0x40
May 19 06:29:57:  [<c012a961>] cache_grow+0x91/0x270
May 19 06:29:57:  [<c012ae3e>] cache_alloc_refill+0x2fe/0x400
May 19 06:29:57:  [<c012b520>] kmem_cache_alloc+0x1a0/0x1b0
May 19 06:29:57:  [<c029dce2>] dst_alloc+0x22/0x90
May 19 06:29:57:  [<c02b7cee>] ip_route_input_slow+0x47e/0x800
May 19 06:29:57:  [<c0253a38>] lba_28_rw_disk+0x88/0x90
May 19 06:29:57:  [<c02dc0e8>] arp_process+0x1e8/0x4c0
May 19 06:29:57:  [<c0303c79>] packet_rcv+0x189/0x2f0
May 19 06:29:57:  [<c029a2b0>] netif_receive_skb+0x150/0x180
May 19 06:29:57:  [<c023f3ac>] tulip_poll+0x44c/0x660
May 19 06:29:57:  [<c029a44c>] net_rx_action+0x6c/0xf0
May 19 06:29:57:  [<c0115b09>] __do_softirq+0x79/0x80
May 19 06:29:57:  [<c0115b37>] do_softirq+0x27/0x30
May 19 06:29:57:  [<c0105525>] do_IRQ+0xd5/0x110
May 19 06:29:57:  [<c0103b6c>] common_interrupt+0x18/0x20
May 19 06:29:57:  [<c012007b>] param_get_long+0x1b/0x30
May 19 06:29:57:  [<c0122ebc>] kallsyms_lookup+0xdc/0x180
May 19 06:29:57:  [<c014515e>] copy_strings+0x1be/0x1f0
May 19 06:29:57:  [<c014515e>] copy_strings+0x1be/0x1f0
May 19 06:29:57:  [<c0122f9a>] __print_symbol+0x3a/0x170
May 19 06:29:57:  [<c01ef150>] complement_pos+0x10/0x160
May 19 06:29:57:  [<c01ef150>] complement_pos+0x10/0x160
May 19 06:29:57:  [<c014515e>] copy_strings+0x1be/0x1f0
May 19 06:29:57:  [<c0103e81>] show_trace+0xb1/0xc0
May 19 06:29:57:  [<c014515e>] copy_strings+0x1be/0x1f0
May 19 06:29:57:  [<c0103f33>] dump_stack+0x13/0x20
May 19 06:29:57:  [<c0127395>] __alloc_pages+0x2d5/0x330
May 19 06:29:57:  [<c012740f>] __get_free_pages+0x1f/0x40
May 19 06:29:57:  [<c012a961>] cache_grow+0x91/0x270
May 19 06:29:57:  [<c012ae3e>] cache_alloc_refill+0x2fe/0x400
May 19 06:29:57:  [<c01261a7>] mempool_alloc+0x67/0x110
May 19 06:29:57:  [<c012b520>] kmem_cache_alloc+0x1a0/0x1b0
May 19 06:29:57:  [<c020dad8>] submit_bio+0x58/0xf0
May 19 06:29:57:  [<c01d1490>] radix_tree_node_alloc+0x10/0x50
May 19 06:29:57:  [<c01d16f9>] radix_tree_insert+0xe9/0x110
May 19 06:29:57:  [<c0138a25>] __add_to_swap_cache+0x55/0xc0
May 19 06:29:57:  [<c0138bbe>] add_to_swap+0x4e/0xb0
May 19 06:29:57:  [<c012deef>] shrink_list+0x3af/0x3e0
May 19 06:29:57:  [<c012e065>] shrink_cache+0x145/0x300
May 19 06:29:57:  [<c012e7a9>] shrink_caches+0x79/0x80
May 19 06:29:57:  [<c012e851>] try_to_free_pages+0xa1/0x180
May 19 06:29:57:  [<c012728c>] __alloc_pages+0x1cc/0x330
May 19 06:29:57:  [<c014515e>] copy_strings+0x1be/0x1f0
May 19 06:29:57:  [<c01451b0>] copy_strings_kernel+0x20/0x30
May 19 06:29:57:  [<c0146125>] do_execve+0x125/0x200
May 19 06:29:57:  [<c0102775>] sys_execve+0x35/0x70
May 19 06:29:57:  [<c01039ff>] syscall_call+0x7/0xb
May 19 06:29:57: 

(Similar repetitions ad nauseam; write if you want them all.)

The memory map is pretty full, as it's a 1GB machine run with a regular 3+1 split. /proc/iomem is as follows:

00000000-0009e7ff : System RAM
0009e800-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000cb3ff : Video ROM
000cc000-000cc7ff : Adapter ROM
000d0000-000d1fff : Adapter ROM
000f0000-000fffff : System ROM
00100000-3fffbfff : System RAM
00100000-0031b833 : Kernel code
0031b834-003f5ebf : Kernel data
3fffc000-3fffefff : ACPI Tables
3ffff000-3fffffff : ACPI Non-volatile Storage
40000000-40000fff : 0000:00:09.0
40000000-40000fff : yenta_socket
40001000-40001fff : 0000:00:09.1
40001000-40001fff : yenta_socket
40400000-407fffff : PCI CardBus #03
40800000-40bfffff : PCI CardBus #03
40c00000-40ffffff : PCI CardBus #07
41000000-413fffff : PCI CardBus #07
de800000-e07fffff : PCI Bus #02
de800000-de8003ff : 0000:02:07.0

    de800000-de8003ff : tulip
  df000000-df0003ff : 0000:02:06.0
    df000000-df0003ff : tulip
  df800000-df8003ff : 0000:02:05.0
    df800000-df8003ff : tulip
  e0000000-e00003ff : 0000:02:04.0
    e0000000-e00003ff : tulip

e0800000-e0803fff : 0000:00:0c.0
e1000000-e1003fff : 0000:00:0b.0
e1800000-e1800fff : 0000:00:0a.0
e2000000-e3cfffff : PCI Bus #01
e2000000-e2ffffff : 0000:01:00.0
e3d00000-e3dfffff : PCI Bus #02
e3f00000-e5ffffff : PCI Bus #01
e4000000-e5ffffff : 0000:01:00.0
e6000000-e7ffffff : 0000:00:00.0
ffff0000-ffffffff : reserved

#1 lore raw
Quoted 35 lines · [email protected] wrote:

I already reported (I thought) this message:

 May 19 02:23:47: Unable to handle kernel paging request at virtual address efd78000
 May 19 02:23:47:  printing eip:
 May 19 02:23:47: c01a999b
 May 19 02:23:47: *pde = 004a7067
 May 19 02:23:47: *pte = 2fd78000
 May 19 02:23:47: Oops: 0002 [#1]
 May 19 02:23:47: DEBUG_PAGEALLOC
 May 19 02:23:47: CPU:    0
 May 19 02:23:47: EIP:    0060:[<c01a999b>]    Not tainted
 May 19 02:23:47: EFLAGS: 00010246   (2.6.6) 
 May 19 02:23:47: EIP is at encode_entry+0x4b/0x530
 May 19 02:23:47: eax: 00000000   ebx: 00000000   ecx: 00000644   edx: f3532df8
 May 19 02:23:47: esi: efd78000   edi: e4a19644   ebp: 00000654   esp: f14b7b98
 May 19 02:23:47: ds: 007b   es: 007b   ss: 0068
 May 19 02:23:47: Process nfsd (pid: 1029, threadinfo=f14b6000 task=f1532a80)
 May 19 02:23:47: Stack: 00000008 0000002f f5217080 00000027 00000000 f5217084 f3532df8 00000006 
 May 19 02:23:47:        e4a1964c 0000001c 02000001 04000900 0019a291 0022e7a8 14343bfc 0022e76b 
 May 19 02:23:47:        14343b61 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 May 19 02:23:47: Call Trace:
 May 19 02:23:47:  [<c016af1f>] ext3_bread+0x1f/0x90
 May 19 02:23:47:  [<c0168505>] ext3_readdir+0x305/0x490
 May 19 02:23:47:  [<c011dd18>] in_group_p+0x38/0x70
 May 19 02:23:47:  [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
 May 19 02:23:47:  [<c019d930>] fh_verify+0x280/0x550
 May 19 02:23:47:  [<c019d5d0>] nfsd_acceptable+0x0/0xe0
 May 19 02:23:47:  [<c013da8c>] open_private_file+0x1c/0x90
 May 19 02:23:47:  [<c014ba2d>] vfs_readdir+0x7d/0x90
 May 19 02:23:47:  [<c01a11f9>] nfsd_readdir+0x79/0xc0
 May 19 02:23:47:  [<c01a6b8a>] nfsd3_proc_readdirplus+0xda/0x1d0
 May 19 02:23:47:  [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
 May 19 02:23:47:  [<c01a8e90>] nfs3svc_decode_readdirplusargs+0x0/0x180
 May 19 02:23:47:  [<c019bce6>] nfsd_dispatch+0xb6/0x1a0
Quoted 8 lines
 May 19 02:23:47:  [<c03139fd>] svc_authenticate+0x4d/0x80
 May 19 02:23:47:  [<c03112d7>] svc_process+0x487/0x5f0
 May 19 02:23:47:  [<c0103b6c>] common_interrupt+0x18/0x20
 May 19 02:23:47:  [<c019bad9>] nfsd+0x179/0x2d0
 May 19 02:23:47:  [<c019b960>] nfsd+0x0/0x2d0
 May 19 02:23:47:  [<c0101fbd>] kernel_thread_helper+0x5/0x18
 May 19 02:23:47: 
 May 19 02:23:47: Code: 89 06 89 c8 0f c8 89 46 04 81 7c 24 1c 00 01 00 00 b8 ff 00 

Is it repeatable? If so, does it go away if you disable CONFIG_DEBUG_PAGEALLOC?

Quoted 9 lines

Which later turned into a reboot-requiring cascade of these:

 May 19 06:29:57:  <4>qmail-rspawn: page allocation failure. order:0, mode:0x20
 May 19 06:29:57: Call Trace:
 May 19 06:29:57:  [<c0127395>] __alloc_pages+0x2d5/0x330
 May 19 06:29:57:  [<c012740f>] __get_free_pages+0x1f/0x40
 May 19 06:29:57:  [<c012a961>] cache_grow+0x91/0x270
 May 19 06:29:57:  [<c012ae3e>] cache_alloc_refill+0x2fe/0x400
 May 19 06:29:57:  [<c01261a7>] mempool_alloc+0x67/0x110

hm, you seem to be totally out of memory in the swapout path and in the tulip Rx ISR. Both codepaths handle that OK as it's not uncommon. This is probably unrelated to the oops, but it's not good.

#2 lore raw
Quoted 4 lines · On Wednesday May 19, [email protected] wrote:
Quoted 3 lines · [email protected] wrote:

I already reported (I thought) this message:

Quoted 9 lines
Quoted 8 lines
 May 19 02:23:47: Unable to handle kernel paging request at virtual address efd78000
 May 19 02:23:47: EIP is at encode_entry+0x4b/0x530
 May 19 02:23:47: eax: 00000000   ebx: 00000000   ecx: 00000644   edx: f3532df8
 May 19 02:23:47: esi: efd78000   edi: e4a19644   ebp: 00000654   esp: f14b7b98
 May 19 02:23:47: 
 May 19 02:23:47: Code: 89 06 89 c8 0f c8 89 46 04 81 7c 24 1c 00 01 00 00 b8 ff 00 

cd->offset is 0xefd78000, which is the start of a, presumably unused, page.

Yes... this patch should fix it.

Thanks for the report.

NeilBrown

===============================================================
Fix NFSD oops in readdir.

If a single readdir entry needs to be split over two pages in the reply, we first encode it into a new page, and then copy the bits into place. When we do this relocation, we have to modify the "offset" pointer to be either in the first or the second page, as appropriate.

If the pointer should be at the start of the second page, it is currently put past the end of the first page.

Note that as the offset and whole response is known to be 4byte-aligned, the offset pointer will never be split over two pages.

----------- Diffstat output ------------

 ./fs/nfsd/nfs3xdr.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs3xdr.c renamed from fs/nfsd/nfs3xdr.c~current~ +1 -1
diff ./fs/nfsd/nfs3xdr.c~current~ ./fs/nfsd/nfs3xdr.c
@@ -936,7 +936,7 @@ encode_entry(struct readdir_cd *ccd, con
 			memmove(tmp, (caddr_t)tmp+len1, len2);
 
 			/* update offset */
-			if (((cd->offset - tmp) << 2) <= len1)
+			if (((cd->offset - tmp) << 2) < len1)
 				cd->offset = p + (cd->offset - tmp);
 			else
 				cd->offset -= len1 >> 2;
#3 lore raw
Quoted 3 lines

Yes... this patch should fix it.

Thanks for the report.

Thanks even more for the fix!

This is indeed playing NFS server to a herd of Suns.

Compiling now. I'll report again in a week or two if the crashes stop. (Sooner if they don't, of course.)

#4 lore raw

Even with neilb's patch, I just got an nfs oops:

Unable to handle kernel paging request at virtual address f2590000
 printing eip:
c01a99a1
*pde = 004b1067
*pte = 32590000
Oops: 0002 [#1]
DEBUG_PAGEALLOC
CPU:    0
EIP:    0060:[<c01a99a1>]    Not tainted
EFLAGS: 00010246   (2.6.6) 

EIP is at encode_entry+0x51/0x530
eax: cc010000 ebx: 00000000 ecx: 000001cc edx: f32dcdf8
esi: f258fffc edi: d4ec21cc ebp: 000001e0 esp: ebfd9b98
ds: 007b es: 007b ss: 0068
Process nfsd (pid: 1059, threadinfo=ebfd8000 task=ec000a80)

Stack: 00000006 0000002f e2c63080 00000027 00000000 e2c63080 f32dcdf8 0000000a 
       d4ec21d4 0000001c 02000001 04000900 002bed40 0019a454 00249005 0019a43b 
       00248f88 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
Call Trace:
 [<c016af69>] ext3_bread+0x69/0x90
 [<c0168505>] ext3_readdir+0x305/0x490
 [<c011dba7>] set_current_groups+0x37/0x40
 [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
 [<c019d930>] fh_verify+0x280/0x550
 [<c019d5d0>] nfsd_acceptable+0x0/0xe0
 [<c013da8c>] open_private_file+0x1c/0x90
 [<c014ba2d>] vfs_readdir+0x7d/0x90
 [<c01a11f9>] nfsd_readdir+0x79/0xc0
 [<c01a6b8a>] nfsd3_proc_readdirplus+0xda/0x1d0
 [<c01a9ed0>] nfs3svc_encode_entry_plus+0x0/0x50
 [<c01a8e90>] nfs3svc_decode_readdirplusargs+0x0/0x180
 [<c019bce6>] nfsd_dispatch+0xb6/0x1a0
 [<c03139fd>] svc_authenticate+0x4d/0x80
 [<c03112d7>] svc_process+0x487/0x5f0
 [<c019bad9>] nfsd+0x179/0x2d0
 [<c019b960>] nfsd+0x0/0x2d0
 [<c0101fbd>] kernel_thread_helper+0x5/0x18

Code: 89 46 04 81 7c 24 1c 00 01 00 00 b8 ff 00 00 00 8b 94 24 24 

This is causing NFS client hangs. Bugger; time to reboot.

#5 lore raw
Quoted 1 line · On May 27, [email protected] wrote:

Even with neilb's patch, I just got an nfs oops:

As Olaf Kirch just said on [email protected]:

Quoted 5 lines

Hi Neil,

you recently posted a patch that should fix readdir encoding in nfsd. You say there

Quoted 7 lines

Note that as the offset and whole response is known to be 4byte-aligned, the offset pointer will never be split over two pages.

This is not true. The dirent offset is a 64bit quantity, so it's quite possible it will be split across the page boundary. I'm working on a patch...

And that is exactly the problem you have hit:

Quoted 10 lines
Unable to handle kernel paging request at virtual address f2590000
 printing eip:
c01a99a1
*pde = 004b1067
*pte = 32590000
Oops: 0002 [#1]
DEBUG_PAGEALLOC
CPU:    0
EIP:    0060:[<c01a99a1>]    Not tainted
EFLAGS: 00010246   (2.6.6) 
Quoted 3 lines

EIP is at encode_entry+0x51/0x530
eax: cc010000 ebx: 00000000 ecx: 000001cc edx: f32dcdf8
esi: f258fffc edi: d4ec21cc ebp: 000001e0 esp: ebfd9b98

Note that "esi" is pointing to 4 bytes from the end of a page, and you are getting a bad reference at the start of the next page. The code is storing a 64bit value here, and it doesn't fit.

Stay tuned....

NeilBrown

#6 lore raw
Quoted 3 lines
Quoted 3 lines

This is not true. The dirent offset is a 64bit quantity, so it's quite possible it will be split across the page boundary. I'm working on a patch...

Here's a patch that hopefully fixes this problem. Please give it a try and let me know.

Neil, does this look okay to you?

Cheers,
Olaf

Signature · 3 lines
Olaf Kirch     |  The Hardware Gods hate me.
[email protected]   |
---------------+ 
fs/nfsd/nfs3proc.c +0 -1
Index: linux-2.6.5/fs/nfsd/nfs3proc.c
===================================================================
@@ -437,7 +437,6 @@
 	resp->buflen = count;
 	resp->common.err = nfs_ok;
 	resp->buffer = argp->buffer;
-	resp->offset = NULL;
 	resp->rqstp = rqstp;
 	nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie, 
 					&resp->common, nfs3svc_encode_entry);
fs/nfsd/nfs3xdr.c +32 -7
Index: linux-2.6.5/fs/nfsd/nfs3xdr.c
===================================================================
@@ -887,8 +887,18 @@
 	int		elen;		/* estimated entry length in words */
 	int		num_entry_words = 0;	/* actual number of words */
 
-	if (cd->offset)
-		xdr_encode_hyper(cd->offset, (u64) offset);
+	if (cd->offset) {
+		u64 offset64 = offset;
+
+		if (unlikely(cd->offset1)) {
+			/* we ended up with offset on a page boundary */
+			*cd->offset = htonl(offset64 >> 32);
+			*cd->offset1 = htonl(offset64 & 0xffffffff);
+			cd->offset1 = NULL;
+		} else {
+			xdr_encode_hyper(cd->offset, (u64) offset);
+		}
+	}
 
 	/*
 	dprintk("encode_entry(%.*s @%ld%s)\n",
@@ -969,17 +979,32 @@
 			/* update offset */
 			cd->offset = cd->buffer + (cd->offset - tmp);
 		} else {
+			unsigned int offset_r = (cd->offset - tmp) << 2;
+
+			/* update pointer to offset location.
+			 * This is a 64bit quantity, so we need to
+			 * deal with 3 cases:
+			 *  -	entirely in first page
+			 *  -	entirely in second page
+			 *  -	4 bytes in each page
+			 */
+			if (offset_r + 8 <= len1) {
+				cd->offset = p + (cd->offset - tmp);
+			} else if (offset_r >= len1) {
+				cd->offset -= len1 >> 2;
+			} else {
+				/* sitting on the fence */
+				BUG_ON(offset_r != len1 - 4);
+				cd->offset = p + (cd->offset - tmp);
+				cd->offset1 = tmp;
+			}
+
 			len2 = (num_entry_words << 2) - len1;
 
 			/* move from temp page to current and next pages */
 			memmove(p, tmp, len1);
 			memmove(tmp, (caddr_t)tmp+len1, len2);
 
-			/* update offset */
-			if (((cd->offset - tmp) << 2) <= len1)
-				cd->offset = p + (cd->offset - tmp);
-			else
-				cd->offset -= len1 >> 2;
 			p = tmp + (len2 >> 2);
 		}
 	}
include/linux/nfsd/xdr3.h +1 -0
Index: linux-2.6.5/include/linux/nfsd/xdr3.h
===================================================================
@@ -183,6 +183,7 @@
 	u32 *			buffer;
 	int			buflen;
 	u32 *			offset;
+	u32 *			offset1;
 	struct svc_rqst *	rqstp;
 
 };
#7 lore raw
Quoted 8 lines · On Thursday May 27, [email protected] wrote:
Quoted 3 lines
Quoted 3 lines

This is not true. The dirent offset is a 64bit quantity, so it's quite possible it will be split across the page boundary. I'm working on a patch...

Here's a patch that hopefully fixes this problem. Please give it a try and let me know.

Neil, does this look okay to you?

Yes, it looks fine.

I'll rediff against 2.6.7-rc1-mm1 (there is a small conflict) and send it to Andrew.

Thanks,
NeilBrown