* kernel BUG at fs/locks.c:1932!
@ 2005-12-21 2:00 Kenny Simpson
2005-12-21 2:54 ` Trond Myklebust
0 siblings, 1 reply; 10+ messages in thread
From: Kenny Simpson @ 2005-12-21 2:00 UTC (permalink / raw)
To: nfs
While running some tests (in this case sio) on 2.6.15-rc5 kernel with a r=
ecent NFS_ALL patch
applied, I got this:
[ 1543.034595] ------------[ cut here ]------------
[ 2687.686724] kernel BUG at fs/locks.c:1932!
[ 2687.690922] invalid operand: 0000 [#3]
[ 2687.694768] PREEMPT SMP=20
[ 2687.697375] Modules linked in: e1000 nvidia agpgart autofs4 parport_pc=
parport floppy=20
ohci_hcd
i2c_i801 i2c_core generic ehci_hcd uhci_hcd usbcore sn
d_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm =
snd_timer snd soundcore
snd_page_alloc psmouse mousedev tg3 bcm5700
[ 2687.723803] CPU: 2
[ 2687.723804] EIP: 0060:[<c0171910>] Tainted: PF VLI
[ 2687.723805] EFLAGS: 00010246 (2.6.15-rc5+nfs-p4)=20
[ 2687.736945] EIP is at locks_remove_flock+0x6f/0x11f
[ 2687.741948] eax: f789023c ebx: f5623920 ecx: 00000000 edx: 00000=
000
[ 2687.748916] esi: f7890e9c edi: f5dccf4c ebp: f65b9180 esp: f5dcc=
e80
[ 2687.755882] ds: 007b es: 007b ss: 0068
[ 2687.760083] Process sio_ntap_linux (pid: 4258, threadinfo=3Df5dcc000 t=
ask=3Df5b81030)
[ 2687.767583] Stack: f5dcceec 00000007 f5dcceec 00000000 00000000 000000=
00 00000000 00000000=20
[ 2687.776216] 00000000 000010a1 00000000 00000000 00000000 000000=
00 f65b9180 00000202=20
[ 2687.784853] 00000000 00000000 ffffffff 7fffffff 00000000 000000=
00 00000000 00000000=20
[ 2687.793484] Call Trace:
[ 2687.796187] [<c015b62f>] __fput+0x90/0x17e
[ 2687.800495] [<c0159d02>] filp_close+0x4d/0x79
[ 2687.805069] [<c0159d9a>] sys_close+0x6c/0x82
[ 2687.809555] [<c0102e63>] sysenter_past_esp+0x54/0x75
[ 2687.814757] Code: 39 68 2c 74 18 89 c6 8b 06 85 c0 75 f3 e8 7a 5d 29 0=
0 81 c4 cc 00 00 00 5b=20
5e
5f 5d c3 0f b6 50 30 f6 c2 02 75 21 80 e2 20 75 0a <0
f> 0b 8c 07 40 ae 42 c0 eb d0 89 34 24 c7 44 24 04 02 00 00 00=20
-Kenny
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around=20
http://mail.yahoo.com=20
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2005-12-21 2:00 Kenny Simpson
@ 2005-12-21 2:54 ` Trond Myklebust
2005-12-21 3:20 ` Kenny Simpson
2005-12-22 20:35 ` Kenny Simpson
0 siblings, 2 replies; 10+ messages in thread
From: Trond Myklebust @ 2005-12-21 2:54 UTC (permalink / raw)
To: Kenny Simpson; +Cc: nfs
On Tue, 2005-12-20 at 18:00 -0800, Kenny Simpson wrote:
> While running some tests (in this case sio) on 2.6.15-rc5 kernel with a recent NFS_ALL patch
> applied, I got this:
>
> [ 1543.034595] ------------[ cut here ]------------
> [ 2687.686724] kernel BUG at fs/locks.c:1932!
Hmm... That indicates that some posix locks are somehow still managing
to survive a close().
How did you trigger this problem? Were you signalling the process?
Cheers,
Trond
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2005-12-21 2:54 ` Trond Myklebust
@ 2005-12-21 3:20 ` Kenny Simpson
2005-12-22 20:35 ` Kenny Simpson
1 sibling, 0 replies; 10+ messages in thread
From: Kenny Simpson @ 2005-12-21 3:20 UTC (permalink / raw)
To: Trond Myklebust; +Cc: nfs
> Hmm... That indicates that some posix locks are somehow still managing
> to survive a close().
>=20
> How did you trigger this problem? Were you signalling the process?
I was not, but I think the tests end by killing the worker threads.
I'll run it again tomorrow. The options were '0 0 64k 4G 20 1' - from me=
mory.
No random reads or writes, 64k block size, 4GB file, 20 seconds duration,=
1 thread.
I did not notice this when running the test... only noticed a bunch of th=
ese later in the syslog.
-Kenny
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around=20
http://mail.yahoo.com=20
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2005-12-21 2:54 ` Trond Myklebust
2005-12-21 3:20 ` Kenny Simpson
@ 2005-12-22 20:35 ` Kenny Simpson
1 sibling, 0 replies; 10+ messages in thread
From: Kenny Simpson @ 2005-12-22 20:35 UTC (permalink / raw)
To: Trond Myklebust; +Cc: nfs
--- Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
> Hmm... That indicates that some posix locks are somehow still managing
> to survive a close().
>=20
> How did you trigger this problem? Were you signalling the process?
I have not been able to reproduce this. I only noticed this the first ti=
me after running many
tests, and some time later observing the syslog.
It looks like this may have been fixed anyway by ASANO Masahiro:
http://www.ussg.iu.edu/hypermail/linux/kernel/0512.2/1531.html
-Kenny
=09
__________________________________________=20
Yahoo! DSL =96 Something to write home about.=20
Just $16.99/mo. or less.=20
dsl.yahoo.com=20
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 10+ messages in thread
* kernel BUG at fs/locks.c:1932!
@ 2006-02-17 15:15 Fermin Molina
2006-02-19 18:27 ` Trond Myklebust
0 siblings, 1 reply; 10+ messages in thread
From: Fermin Molina @ 2006-02-17 15:15 UTC (permalink / raw)
To: linux-kernel
Hi,
I run samba sharing NFS mounted shares from another machine. I'm getting
the following bugs in console (and in logs), when I stop samba (but not
always, I think it depends of stalled locks):
lockd: unexpected unlock status: 7
lockd: unexpected unlock status: 7
lockd: unexpected unlock status: 7
------------[ cut here ]------------
kernel BUG at fs/locks.c:1932!
invalid operand: 0000 [#1]
SMP
last sysfs file: /class/vc/vcsa5/dev
Modules linked in: nfsd exportfs parport_pc lp parport nfs lockd nfs_acl sunrpc
video button battery ac i2c_piix4 i2c_core eepro100 cpqphp e1000 e100 mii floppy ext3 jbd dm_mod cciss sd_mod scsi_mod
CPU: 5
EIP: 0060:[<c017f12f>] Not tainted VLI
EFLAGS: 00010246 (2.6.15-1.1831_FC4smp)
EIP is at locks_remove_flock+0xc5/0xe8
eax: cbaccc78 ebx: d49d4828 ecx: f7fff180 edx: 00000000
esi: d972a980 edi: d49d4760 ebp: cbaccc78 esp: e993ef08
ds: 007b es: 007b ss: 0068
Process smbd (pid: 25624, threadinfo=e993e000 task=f7e5a000)
Stack: 00000000 00000000 00000000 00000000 00000000 d972a980 00006418 00000000
00000000 00000000 00000000 00000000 00000000 d972a980 00000202 00000000
00000000 ffffffff 7fffffff 00000000 00000000 00000000 00000000 00000000
Call Trace:
[<c016a5fe>] __fput+0x9a/0x186 [<c0168e71>] filp_close+0x3e/0x62
[<c0104035>] syscall_call+0x7/0xb
Code: c0 74 0d 3b 70 34 74 15 89 c3 8b 03 85 c0 75 f3 e8 82 ca 1a 00 83 c4 68 5b 5e 5f 5d c3 0f b6 50 38 f6 c2 02 75 11 80 e2 20 75 15 <0f> 0b 8c 07 df ad 34 c0 89 c3 eb d3 89 d8 e8 0f df ff ff eb bd
Continuing in 1 seconds.
------------------------
Feb 16 16:02:06 users kernel: ------------[ cut here ]------------
Feb 16 16:02:06 users kernel: kernel BUG at fs/locks.c:1932!
Feb 16 16:02:06 users kernel: invalid operand: 0000 [#1]
Feb 16 16:02:06 users kernel: SMP
Feb 16 16:02:06 users kernel: last sysfs file: /block/dm-2/dev
Feb 16 16:02:06 users kernel: Modules linked in: nfsd exportfs parport_pc lp parport nfs lockd nfs_acl sunrpc video button battery ac i2c_piix4 i2c_core eepro100 cpqphp e1000 e100 mii floppy ext3 jbd dm_mod cciss sd_mod scsi_mod
Feb 16 16:02:06 users kernel: CPU: 5
Feb 16 16:02:06 users kernel: EIP: 0060:[<c017f12f>] Not tainted VLI
Feb 16 16:02:06 users kernel: EFLAGS: 00010246 (2.6.15-1.1831_FC4smp)
Feb 16 16:02:06 users kernel: EIP is at locks_remove_flock+0xc5/0xe8
Feb 16 16:02:06 users kernel: eax: f2553ee8 ebx: e6ab9238 ecx: 00b6c507 edx: 00000000
Feb 16 16:02:06 users kernel: esi: ed840180 edi: e6ab9170 ebp: f2553ee8 esp: f60a8f08
Feb 16 16:02:06 users kernel: ds: 007b es: 007b ss: 0068
Feb 16 16:02:06 users kernel: Process smbd (pid: 4846, threadinfo=f60a8000 task=f7cbd550)
Feb 16 16:02:06 users kernel: Stack: 00000000 00000000 00000000 00000000 00000000 ed840180 000012ee 00000000
Feb 16 16:02:07 users kernel: 00000000 00000000 00000000 00000000 00000000 ed840180 00000202 00000000
Feb 16 16:02:07 users kernel: 00000000 ffffffff 7fffffff 00000000 00000000 00000000 00000000 00000000
Feb 16 16:02:07 users kernel: Call Trace:
Feb 16 16:02:08 users kernel: [<c016a5fe>] __fput+0x9a/0x186 [<c0168e71>] filp_close+0x3e/0x62
Feb 16 16:02:08 users kernel: [<c0104035>] syscall_call+0x7/0xb
Feb 16 16:02:08 users kernel: Code: c0 74 0d 3b 70 34 74 15 89 c3 8b 03 85 c0 75 f3 e8 82 ca 1a 00 83 c4 68 5b 5e 5f 5d c3 0f b6 50 38 f6 c2 02 75 11 80 e2 20 75 15 <0f> 0b 8c 07 df ad 34 c0 89 c3 eb d3 89 d8 e8 0f df ff ff eb bd
Feb 16 16:02:08 users kernel: Continuing in 120 seconds.
------------------------
Feb 17 10:00:02 users nmbd[11718]: [2006/02/17 10:00:02, 0] nmbd/nmbd.c:terminate(58)
Feb 17 10:00:02 users nmbd[11718]: Got SIGTERM: going down...
Feb 17 10:00:09 users kernel: ------------[ cut here ]------------
Feb 17 10:00:09 users kernel: kernel BUG at fs/locks.c:1932!
Feb 17 10:00:09 users kernel: invalid operand: 0000 [#2]
Feb 17 10:00:09 users kernel: SMP
Feb 17 10:00:09 users kernel: last sysfs file: /block/dm-2/dev
Feb 17 10:00:09 users kernel: Modules linked in: nfsd exportfs parport_pc lp parport nfs lockd nfs_acl sunrpc video button battery ac i2c_piix4 i2c_core eepro100 cpqphp e1000 e100 mii floppy ext3 jbd dm_mod cciss sd_mod scsi_mod
Feb 17 10:00:09 users kernel: CPU: 0
Feb 17 10:00:09 users kernel: EIP: 0060:[<c017f12f>] Not tainted VLI
Feb 17 10:00:09 users kernel: EFLAGS: 00010246 (2.6.15-1.1831_FC4smp)
Feb 17 10:00:09 users kernel: EIP is at locks_remove_flock+0xc5/0xe8
Feb 17 10:00:09 users kernel: eax: e7399a08 ebx: ea8b6e18 ecx: f7fff180 edx: 00000000
Feb 17 10:00:09 users kernel: esi: f7dd3e80 edi: ea8b6d50 ebp: e7399a08 esp: cf7c0f08
Feb 17 10:00:09 users kernel: ds: 007b es: 007b ss: 0068
Feb 17 10:00:09 users kernel: Process smbd (pid: 11799, threadinfo=cf7c0000 task=f7de7550)
Feb 17 10:00:09 users kernel: Stack: 00000000 00000000 00000000 00000000 00000000 f7dd3e80 00002e17 00000000
Feb 17 10:00:09 users kernel: 00000000 00000000 00000000 00000000 00000000 f7dd3e80 00000202 00000000
Feb 17 10:00:09 users kernel: 00000000 ffffffff 7fffffff 00000000 00000000 00000000 00000000 00000000
Feb 17 10:00:09 users kernel: Call Trace:
Feb 17 10:00:09 users kernel: [<c016a5fe>] __fput+0x9a/0x186 [<c0168e71>] filp_close+0x3e/0x62
Feb 17 10:00:09 users kernel: [<c0104035>] syscall_call+0x7/0xb
Feb 17 10:00:10 users kernel: Code: c0 74 0d 3b 70 34 74 15 89 c3 8b 03 85 c0 75 f3 e8 82 ca 1a 00 83 c4 68 5b 5e 5f 5d c3 0f b6 50 38 f6 c2 02 75 11 80 e2 20 75 15 <0f> 0b 8c 07 df ad 34 c0 89 c3 eb d3 89 d8 e8 0f df ff ff eb bd
Feb 17 10:00:10 users kernel: Continuing in 120 seconds.
------------------------
Feb 17 14:00:02 users nmbd[20963]: [2006/02/17 14:00:02, 0] nmbd/nmbd.c:terminate(58)
Feb 17 14:00:02 users nmbd[20963]: Got SIGTERM: going down...
Feb 17 14:00:09 users kernel: ------------[ cut here ]------------
Feb 17 14:00:09 users kernel: kernel BUG at fs/locks.c:1932!
Feb 17 14:00:09 users kernel: invalid operand: 0000 [#3]
Feb 17 14:00:09 users kernel: SMP
Feb 17 14:00:09 users kernel: last sysfs file: /block/dm-2/dev
Feb 17 14:00:09 users kernel: Modules linked in: nfsd exportfs parport_pc lp parport nfs lockd nfs_acl sunrpc video button battery ac i2c_piix4 i2c_core eepro100 cpqphp e1000 e100 mii floppy ext3 jbd dm_mod cciss sd_mod scsi_mod
Feb 17 14:00:09 users kernel: CPU: 0
Feb 17 14:00:09 users kernel: EIP: 0060:[<c017f12f>] Not tainted VLI
Feb 17 14:00:09 users kernel: EFLAGS: 00010246 (2.6.15-1.1831_FC4smp)
Feb 17 14:00:09 users kernel: EIP is at locks_remove_flock+0xc5/0xe8
Feb 17 14:00:09 users kernel: eax: e23d3798 ebx: f7936530 ecx: f7fff180 edx: 00000000
Feb 17 14:00:09 users kernel: esi: f7f06580 edi: f7936468 ebp: e23d3798 esp: edf05f08
Feb 17 14:00:09 users kernel: ds: 007b es: 007b ss: 0068
Feb 17 14:00:10 users kernel: Process smbd (pid: 21685, threadinfo=edf05000 task=ddc28550)
Feb 17 14:00:10 users rpc.mountd: authenticated unmount request from RECTOR128.udl.net:699 for /usuaris/users (/usuaris/users)
Feb 17 14:00:10 users kernel: Stack: 00000000 00000000 00000000 00000000 00000000 f7f06580 000054b5 00000000
Feb 17 14:00:10 users kernel: 00000000 00000000 00000000 00000000 00000000 f7f06580 00000202 00000000
Feb 17 14:00:10 users kernel: 00000000 ffffffff 7fffffff 00000000 00000000 00000000 00000000 00000000
Feb 17 14:00:10 users kernel: Call Trace:
Feb 17 14:00:10 users kernel: [<c016a5fe>] __fput+0x9a/0x186 [<c0168e71>] filp_close+0x3e/0x62
Feb 17 14:00:11 users kernel: [<c0104035>] syscall_call+0x7/0xb
Feb 17 14:00:11 users kernel: Code: c0 74 0d 3b 70 34 74 15 89 c3 8b 03 85 c0 75 f3 e8 82 ca 1a 00 83 c4 68 5b 5e 5f 5d c3 0f b6 50 38 f6 c2 02 75 11 80 e2 20 75 15 <0f> 0b 8c 07 df ad 34 c0 89 c3 eb d3 89 d8 e8 0f df ff ff eb bd
Feb 17 14:00:11 users kernel: Continuing in 120 seconds.
------------------------
I think this is a problem with file locking in NFS code, and samba
triggers this bug. In fact, all samba locking over NFS works very, very
bad and samba shares gets stalled constantly.
I read this http://lkml.org/lkml/2005/12/21/334 but kernel I use have
this patch applied (I use kernel 2.6.15.3). The client with samba is a
i386 based machine with SMP (4 processors); the NFS server is a Solaris
7.
Thanks in advance,
--
Fermin Molina Ibarz
Tècnic sistemes - ASIC
Universitat de Lleida
Tel: +34 973 702151
GPG: 0x060F857A
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2006-02-17 15:15 kernel BUG at fs/locks.c:1932! Fermin Molina
@ 2006-02-19 18:27 ` Trond Myklebust
2006-02-25 15:35 ` Adrian Bunk
2006-02-27 22:56 ` Fermin Molina
0 siblings, 2 replies; 10+ messages in thread
From: Trond Myklebust @ 2006-02-19 18:27 UTC (permalink / raw)
To: Fermin Molina; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 764 bytes --]
On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> Hi,
>
> I run samba sharing NFS mounted shares from another machine. I'm getting
> the following bugs in console (and in logs), when I stop samba (but not
> always, I think it depends of stalled locks):
>
> lockd: unexpected unlock status: 7
> lockd: unexpected unlock status: 7
> lockd: unexpected unlock status: 7
> ------------[ cut here ]------------
Hmm... The problem here is that the server is returning an unexpected
error: it is normally supposed to return "lock granted" or "grace
error", but is actually returning "stale filehandle".
Anyhow, the client should be able to deal with this without Oopsing.
The attached patch ought to fix that. Please could you give it a try?
Cheers,
Trond
[-- Attachment #2: linux-2.6.16-68-fix_unlock_bad_res.dif --]
[-- Type: text/plain, Size: 1078 bytes --]
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
NLM: Ensure we do not Oops in the case of an unlock
In theory, NLM specs assure us that the server will only reply LCK_GRANTED
or LCK_DENIED_GRACE_PERIOD to our NLM_UNLOCK request.
In practice, we should not assume this to be the case, and the code will
currently Oops if we do.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
fs/lockd/clntproc.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 7e89655..da76592 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -644,10 +644,16 @@ nlmclnt_unlock(struct nlm_rqst *req, str
status = nlmclnt_call(req, NLMPROC_UNLOCK);
nlmclnt_release_lockargs(req);
+ /*
+ * Note: the server is supposed to either grant us the unlock
+ * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
+ * case, we want to unlock.
+ */
+ do_vfs_lock(fl);
+
if (status < 0)
return status;
- do_vfs_lock(fl);
if (resp->status == NLM_LCK_GRANTED)
return 0;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2006-02-19 18:27 ` Trond Myklebust
@ 2006-02-25 15:35 ` Adrian Bunk
2006-02-25 15:46 ` Jesper Juhl
2006-02-25 16:04 ` Trond Myklebust
2006-02-27 22:56 ` Fermin Molina
1 sibling, 2 replies; 10+ messages in thread
From: Adrian Bunk @ 2006-02-25 15:35 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Fermin Molina, linux-kernel
On Sun, Feb 19, 2006 at 01:27:55PM -0500, Trond Myklebust wrote:
> On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> > Hi,
> >
> > I run samba sharing NFS mounted shares from another machine. I'm getting
> > the following bugs in console (and in logs), when I stop samba (but not
> > always, I think it depends of stalled locks):
> >
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > ------------[ cut here ]------------
>
> Hmm... The problem here is that the server is returning an unexpected
> error: it is normally supposed to return "lock granted" or "grace
> error", but is actually returning "stale filehandle".
>
> Anyhow, the client should be able to deal with this without Oopsing.
This seems to be a patch that should go into 2.6.16?
> The attached patch ought to fix that. Please could you give it a try?
>
> Cheers,
> Trond
> Author: Trond Myklebust <Trond.Myklebust@netapp.com>
> NLM: Ensure we do not Oops in the case of an unlock
>
> In theory, NLM specs assure us that the server will only reply LCK_GRANTED
> or LCK_DENIED_GRACE_PERIOD to our NLM_UNLOCK request.
>
> In practice, we should not assume this to be the case, and the code will
> currently Oops if we do.
>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
>
> fs/lockd/clntproc.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
> index 7e89655..da76592 100644
> --- a/fs/lockd/clntproc.c
> +++ b/fs/lockd/clntproc.c
> @@ -644,10 +644,16 @@ nlmclnt_unlock(struct nlm_rqst *req, str
>
> status = nlmclnt_call(req, NLMPROC_UNLOCK);
> nlmclnt_release_lockargs(req);
> + /*
> + * Note: the server is supposed to either grant us the unlock
> + * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
> + * case, we want to unlock.
> + */
> + do_vfs_lock(fl);
> +
> if (status < 0)
> return status;
>
> - do_vfs_lock(fl);
> if (resp->status == NLM_LCK_GRANTED)
> return 0;
>
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2006-02-25 15:35 ` Adrian Bunk
@ 2006-02-25 15:46 ` Jesper Juhl
2006-02-25 16:04 ` Trond Myklebust
1 sibling, 0 replies; 10+ messages in thread
From: Jesper Juhl @ 2006-02-25 15:46 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Trond Myklebust, Fermin Molina, linux-kernel
On 2/25/06, Adrian Bunk <bunk@stusta.de> wrote:
> On Sun, Feb 19, 2006 at 01:27:55PM -0500, Trond Myklebust wrote:
> > On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> > > Hi,
> > >
> > > I run samba sharing NFS mounted shares from another machine. I'm getting
> > > the following bugs in console (and in logs), when I stop samba (but not
> > > always, I think it depends of stalled locks):
> > >
> > > lockd: unexpected unlock status: 7
> > > lockd: unexpected unlock status: 7
> > > lockd: unexpected unlock status: 7
> > > ------------[ cut here ]------------
> >
> > Hmm... The problem here is that the server is returning an unexpected
> > error: it is normally supposed to return "lock granted" or "grace
> > error", but is actually returning "stale filehandle".
> >
> > Anyhow, the client should be able to deal with this without Oopsing.
>
>
> This seems to be a patch that should go into 2.6.16?
>
I'd agree and suggest that it also be send to -stable since it fixes a
crash actually seen "in the wild".
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2006-02-25 15:35 ` Adrian Bunk
2006-02-25 15:46 ` Jesper Juhl
@ 2006-02-25 16:04 ` Trond Myklebust
1 sibling, 0 replies; 10+ messages in thread
From: Trond Myklebust @ 2006-02-25 16:04 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Fermin Molina, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Sat, 2006-02-25 at 16:35 +0100, Adrian Bunk wrote:
> On Sun, Feb 19, 2006 at 01:27:55PM -0500, Trond Myklebust wrote:
> > On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> > > Hi,
> > >
> > > I run samba sharing NFS mounted shares from another machine. I'm getting
> > > the following bugs in console (and in logs), when I stop samba (but not
> > > always, I think it depends of stalled locks):
> > >
> > > lockd: unexpected unlock status: 7
> > > lockd: unexpected unlock status: 7
> > > lockd: unexpected unlock status: 7
> > > ------------[ cut here ]------------
> >
> > Hmm... The problem here is that the server is returning an unexpected
> > error: it is normally supposed to return "lock granted" or "grace
> > error", but is actually returning "stale filehandle".
> >
> > Anyhow, the client should be able to deal with this without Oopsing.
>
>
> This seems to be a patch that should go into 2.6.16?
I'm still waiting to hear if it fixes the problem. In the meantime, here
is a slightly cleaner version, that also fixes most of those "unexpected
un/lock status" messages.
Cheers,
Trond
[-- Attachment #2: linux-2.6.16-04-fix_unlock_bad_res.dif --]
[-- Type: text/plain, Size: 1492 bytes --]
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
NLM: Ensure we do not Oops in the case of an unlock
In theory, NLM specs assure us that the server will only reply LCK_GRANTED
or LCK_DENIED_GRACE_PERIOD to our NLM_UNLOCK request.
In practice, we should not assume this to be the case, and the code will
currently Oops if we do.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
fs/lockd/clntproc.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 220058d..970b6a6 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -662,12 +662,18 @@ nlmclnt_unlock(struct nlm_rqst *req, str
* reclaimed while we're stuck in the unlock call. */
fl->fl_u.nfs_fl.flags &= ~NFS_LCK_GRANTED;
+ /*
+ * Note: the server is supposed to either grant us the unlock
+ * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
+ * case, we want to unlock.
+ */
+ do_vfs_lock(fl);
+
if (req->a_flags & RPC_TASK_ASYNC) {
status = nlmclnt_async_call(req, NLMPROC_UNLOCK,
&nlmclnt_unlock_ops);
/* Hrmf... Do the unlock early since locks_remove_posix()
* really expects us to free the lock synchronously */
- do_vfs_lock(fl);
if (status < 0) {
nlmclnt_release_lockargs(req);
kfree(req);
@@ -680,7 +686,6 @@ nlmclnt_unlock(struct nlm_rqst *req, str
if (status < 0)
return status;
- do_vfs_lock(fl);
if (resp->status == NLM_LCK_GRANTED)
return 0;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: kernel BUG at fs/locks.c:1932!
2006-02-19 18:27 ` Trond Myklebust
2006-02-25 15:35 ` Adrian Bunk
@ 2006-02-27 22:56 ` Fermin Molina
1 sibling, 0 replies; 10+ messages in thread
From: Fermin Molina @ 2006-02-27 22:56 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-kernel
On Sun, 2006-02-19 at 13:27 -0500, Trond Myklebust wrote:
> On Fri, 2006-02-17 at 16:15 +0100, Fermin Molina wrote:
> > Hi,
> >
> > I run samba sharing NFS mounted shares from another machine. I'm getting
> > the following bugs in console (and in logs), when I stop samba (but not
> > always, I think it depends of stalled locks):
> >
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > lockd: unexpected unlock status: 7
> > ------------[ cut here ]------------
>
> Hmm... The problem here is that the server is returning an unexpected
> error: it is normally supposed to return "lock granted" or "grace
> error", but is actually returning "stale filehandle".
>
> Anyhow, the client should be able to deal with this without Oopsing.
>
> The attached patch ought to fix that. Please could you give it a try?
Sorry for the delay. I cannot try the patch in this moment, because my
server is in production. I will try the patch next days, but I think I
cannot reproduce the error, because I made "local" some data mounted
with NFS.
In samba list, some people that have data mounted with NFS are getting
similar problems. I will let they know about this patch.
Thanks a lot,
--
Fermin Molina Ibarz
Tècnic sistemes - ASIC
Universitat de Lleida
Tel: +34 973 702151
GPG: 0x060F857A
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-02-27 22:56 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-17 15:15 kernel BUG at fs/locks.c:1932! Fermin Molina
2006-02-19 18:27 ` Trond Myklebust
2006-02-25 15:35 ` Adrian Bunk
2006-02-25 15:46 ` Jesper Juhl
2006-02-25 16:04 ` Trond Myklebust
2006-02-27 22:56 ` Fermin Molina
-- strict thread matches above, loose matches on Subject: below --
2005-12-21 2:00 Kenny Simpson
2005-12-21 2:54 ` Trond Myklebust
2005-12-21 3:20 ` Kenny Simpson
2005-12-22 20:35 ` Kenny Simpson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.