tree 5be25dc1f1222d2998a9754e5b5e26d516601b9d
parent 67be431350941765e211eeed237c12def3aaba70
author NeilBrown <[EMAIL PROTECTED]> Fri, 08 Jul 2005 07:59:14 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Fri, 08 Jul 2005 08:24:08 -0700

[PATCH] nfsd4: fix release_lockowner

We oops in list_for_each_entry(), because release_stateowner frees something
on the list we're traversing.

Signed-off-by: Andy Adamson <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 fs/nfsd/nfs4state.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3084,7 +3084,12 @@ nfsd4_release_lockowner(struct svc_rqst 
         * of the lockowner state released; so don't release any until all
         * have been checked. */
        status = nfs_ok;
-       list_for_each_entry(sop, &matches, so_perclient) {
+       while (!list_empty(&matches)) {
+               sop = list_entry(matches.next, struct nfs4_stateowner,
+                                                               so_perclient);
+               /* unhash_stateowner deletes so_perclient only
+                * for openowners. */
+               list_del(&sop->so_perclient);
                release_stateowner(sop);
        }
 out:
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to