Skip to contentSkip to conversation

"Panic: unable to handle kernel page request" in posix_unblock_lock() called from nfs4_laundromat()

Bug 197817 Naofumi Honda 3 participants 3 messages Nov 9, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#2 lore raw

Dear Developers:

Quoted 9 lines

https://bugzilla.kernel.org/show_bug.cgi?id=197817

--- Comment #1 from [email protected] ---
Yes, I think you're right.

Would it be possible for you to submit a patch to fix that typo in those two places? (Just mail it to me at [email protected], cc: to [email protected]).

OK, I have attached the patch.

Quoted 1 line

It might also be useful to see your original oops.

Sorry, I have the only handwriting memo of console messages. Maybe useless, but I also attach its scanned copy.

Sincerely yours
Naofumi Honda

*** linux-4.9.60/fs/nfsd/nfs4state.c.org 2017-11-09 09:49:11.071026183 +0900
--- linux-4.9.60/fs/nfsd/nfs4state.c 2017-11-09 09:51:36.370697280 +0900
***************
*** 4677,4683 ****
spin_unlock(&nn->blocked_locks_lock);

while (!list_empty(&reaplist)) {
! nbl = list_first_entry(&nn->blocked_locks_lru,
struct nfsd4_blocked_lock, nbl_lru);
list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock);
--- 4677,4683 ----
spin_unlock(&nn->blocked_locks_lock);

while (!list_empty(&reaplist)) {
! nbl = list_first_entry(&reaplist,
struct nfsd4_blocked_lock, nbl_lru);
list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock);
***************
*** 7071,7077 ****
spin_unlock(&nn->blocked_locks_lock);

while (!list_empty(&reaplist)) {
! nbl = list_first_entry(&nn->blocked_locks_lru,
struct nfsd4_blocked_lock, nbl_lru);
list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock);
--- 7071,7077 ----
spin_unlock(&nn->blocked_locks_lock);

while (!list_empty(&reaplist)) {
! nbl = list_first_entry(&reaplist,
struct nfsd4_blocked_lock, nbl_lru);
list_del_init(&nbl->nbl_lru); posix_unblock_lock(&nbl->nbl_lock);

#3 lore raw
Quoted 7 lines · Naofumi Honda

Dear Developers:

Quoted 5 lines

https://bugzilla.kernel.org/show_bug.cgi?id=197817

--- Comment #1 from [email protected] ---
Yes, I think you're right.

Quoted 6 lines
Quoted 4 lines

Would it be possible for you to submit a patch to fix that typo in those two places? (Just mail it to me at [email protected], cc: to [email protected]).

OK, I have attached the patch.

Thanks for the investigation and the fix!

For future reference, we prefer patches to be inline with the email message (not attached), and prefer them in "unified" format.

But for a one-off patch I can fix it up myself; applied as follows.

--b.

commit c26806a20fa3

Author: Naofumi Honda <[email protected]>
Date:   Thu Nov 9 10:57:16 2017 -0500

nfsd: fix panic in posix_unblock_lock called from nfs4_laundromat

From kernel 4.9, my two nfsv4 servers sometimes suffer from
"panic: unable to handle kernel page request"
in posix_unblock_lock() called from nfs4_laundromat().

These panics diseappear if we revert the commit "nfsd: add a LRU list for blocked locks".

The cause appears to be a typo in nfs4_laundromat(), which is also present in nfs4_state_shutdown_net().

Fixes 7919d0a27f1e "nfsd: add a LRU list for blocked locks"
fs/nfsd/nfs4state.c +2 -2
index 923243369bbc..b99830ab63aa 100644
@@ -4791,7 +4791,7 @@ nfs4_laundromat(struct nfsd_net *nn)
 	spin_unlock(&nn->blocked_locks_lock);
 
 	while (!list_empty(&reaplist)) {
-		nbl = list_first_entry(&nn->blocked_locks_lru,
+		nbl = list_first_entry(&reaplist,
 					struct nfsd4_blocked_lock, nbl_lru);
 		list_del_init(&nbl->nbl_lru);
 		posix_unblock_lock(&nbl->nbl_lock);
@@ -7260,7 +7260,7 @@ nfs4_state_shutdown_net(struct net *net)
 	spin_unlock(&nn->blocked_locks_lock);
 
 	while (!list_empty(&reaplist)) {
-		nbl = list_first_entry(&nn->blocked_locks_lru,
+		nbl = list_first_entry(&reaplist,
 					struct nfsd4_blocked_lock, nbl_lru);
 		list_del_init(&nbl->nbl_lru);
 		posix_unblock_lock(&nbl->nbl_lock);
Reviewed-by
#4 lore raw
Quoted 59 lines · J. Bruce Fields
Quoted 7 lines · Naofumi Honda

Dear Developers:

Quoted 5 lines

https://bugzilla.kernel.org/show_bug.cgi?id=197817

--- Comment #1 from [email protected] ---
Yes, I think you're right.

Quoted 6 lines
Quoted 4 lines

Would it be possible for you to submit a patch to fix that typo in those two places? (Just mail it to me at [email protected], cc: to [email protected]).

OK, I have attached the patch.

Thanks for the investigation and the fix!

For future reference, we prefer patches to be inline with the email message (not attached), and prefer them in "unified" format.

But for a one-off patch I can fix it up myself; applied as follows.

--b.

commit c26806a20fa3

Author: Naofumi Honda <[email protected]>
Date:   Thu Nov 9 10:57:16 2017 -0500

nfsd: fix panic in posix_unblock_lock called from nfs4_laundromat

From kernel 4.9, my two nfsv4 servers sometimes suffer from
"panic: unable to handle kernel page request"
in posix_unblock_lock() called from nfs4_laundromat().

These panics diseappear if we revert the commit "nfsd: add a LRU list for blocked locks".

The cause appears to be a typo in nfs4_laundromat(), which is also present in nfs4_state_shutdown_net().

Fixes 7919d0a27f1e "nfsd: add a LRU list for blocked locks"
fs/nfsd/nfs4state.c +1 -1
index 923243369bbc..b99830ab63aa 100644
@@ -4791,7 +4791,7 @@ nfs4_laundromat(struct nfsd_net *nn)
 	spin_unlock(&nn->blocked_locks_lock);
 
 	while (!list_empty(&reaplist)) {
-		nbl = list_first_entry(&nn->blocked_locks_lru,
+		nbl = list_first_entry(&reaplist,
 					struct nfsd4_blocked_lock, nbl_lru);
 		list_del_init(&nbl->nbl_lru);
 		posix_unblock_lock(&nbl->nbl_lock);

fs/nfsd/nfs4state.c nfs4_state_shutdown_net(struct net *net) · line 7266

Quoted 8 lines
fs/nfsd/nfs4state.c +1 -1
@@ -7260,7 +7260,7 @@ nfs4_state_shutdown_net(struct net *net)
 	spin_unlock(&nn->blocked_locks_lock);
 
 	while (!list_empty(&reaplist)) {
-		nbl = list_first_entry(&nn->blocked_locks_lru,
+		nbl = list_first_entry(&reaplist,
 					struct nfsd4_blocked_lock, nbl_lru);
 		list_del_init(&nbl->nbl_lru);
 		posix_unblock_lock(&nbl->nbl_lock);

<facepalm>

Well spotted! I wonder if this might be the cause of some crashes we've seen as well?