diff mbox

kernel 3.8.4 : kernel BUG at fs/locks.c:2093! part #2

Message ID 20130329184331.GH22307@fieldses.org (mailing list archive)
State New, archived
Headers show

Commit Message

J. Bruce Fields March 29, 2013, 6:43 p.m. UTC
On Wed, Mar 27, 2013 at 05:57:27PM -0400, J. Bruce Fields wrote:
> On Wed, Mar 27, 2013 at 10:35:12PM +0100, Toralf Förster wrote:
> > On 03/26/2013 03:46 PM, J. Bruce Fields wrote:
> > > Can you run with test patches?
> > 
> > applied - today I got a warning instead a bug at the host kernel (3.8.4):
> 
> Excellent!  Thanks, I think I see the bug now....

This logic is just terrible; I'll see what if I can make this more
sensible.

For now, though, this should fix the bug.

Thanks again for this testing.

--b.

commit 01463db0a864d43bd2c9a69ff37d5a75b7822a49
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Thu Mar 28 20:37:14 2013 -0400

    nfsd4: don't close read-write opens too soon
    
    Don't actually close any opens until we don't need them at all.
    
    This means being left with write access when it's not really necessary,
    but that's better than putting a file that might still have posix locks
    held on it, as we have been.
    
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Toralf Förster April 1, 2013, 8:26 p.m. UTC | #1
On 03/29/2013 07:43 PM, J. Bruce Fields wrote:
> For now, though, this should fix the bug.
> 
> Thanks again for this testing.
With this patch applied on top of 3.8.5 the bug could not be reproduced
any longer (till now).

@Dave
Just Cc:'ed you for your trinity score card
:-)
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index aac878e..285a0c8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -210,13 +210,7 @@  static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
 {
 	if (atomic_dec_and_test(&fp->fi_access[oflag])) {
 		nfs4_file_put_fd(fp, oflag);
-		/*
-		 * It's also safe to get rid of the RDWR open *if*
-		 * we no longer have need of the other kind of access
-		 * or if we already have the other kind of open:
-		 */
-		if (fp->fi_fds[1-oflag]
-			|| atomic_read(&fp->fi_access[1 - oflag]) == 0)
+		if (atomic_read(&fp->fi_access[1 - oflag]) == 0)
 			nfs4_file_put_fd(fp, O_RDWR);
 	}
 }