Correctly close old nfsd/lockd sockets.
authorNeil Brown <neilb@suse.de>
Fri, 14 Sep 2007 14:28:08 +0000 (10:28 -0400)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 14 Sep 2007 20:58:11 +0000 (13:58 -0700)
Commit aaf68cfbf2241d24d46583423f6bff5c47e088b3 added a bias
to sk_inuse, so this test for an unused socket now fails.  So no
sockets get closed because they are old (they might get closed
if the client closed them).

This bug has existed since 2.6.21-rc1.

Thanks to Wolfgang Walter for finding and reporting the bug.

Cc: Wolfgang Walter <wolfgang.walter@studentenwerk.mhn.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
net/sunrpc/svcsock.c

index 12ff5da8160e5af375392da32dd13e616edd8667..1a899924023faefc4e6a65b2ab80f4918306e05a 100644 (file)
@@ -1592,7 +1592,7 @@ svc_age_temp_sockets(unsigned long closure)
 
                if (!test_and_set_bit(SK_OLD, &svsk->sk_flags))
                        continue;
-               if (atomic_read(&svsk->sk_inuse) || test_bit(SK_BUSY, &svsk->sk_flags))
+               if (atomic_read(&svsk->sk_inuse) > 1 || test_bit(SK_BUSY, &svsk->sk_flags))
                        continue;
                atomic_inc(&svsk->sk_inuse);
                list_move(le, &to_be_aged);