Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352966
b: refs/heads/master
c: c137afa
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 11, 2013
1 parent f826ba6 commit 4d37a48
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5f5e9c5d2e9178fb0bfe4f44f0afcc8ad6488ef
refs/heads/master: c137afabe330f64eddcd4dd281258807e27fd430
3 changes: 3 additions & 0 deletions trunk/fs/nfs/nfs4_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#define NFS4_MAX_LOOP_ON_RECOVER (10)

#include <linux/seqlock.h>

struct idmap;

enum nfs4_client_state {
Expand Down Expand Up @@ -90,6 +92,7 @@ struct nfs4_state_owner {
unsigned long so_flags;
struct list_head so_states;
struct nfs_seqid_counter so_seqid;
seqcount_t so_reclaim_seqcount;
};

enum {
Expand Down
10 changes: 9 additions & 1 deletion trunk/fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ nfs4_alloc_state_owner(struct nfs_server *server,
nfs4_init_seqid_counter(&sp->so_seqid);
atomic_set(&sp->so_count, 1);
INIT_LIST_HEAD(&sp->so_lru);
seqcount_init(&sp->so_reclaim_seqcount);
return sp;
}

Expand Down Expand Up @@ -1390,8 +1391,9 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
* recovering after a network partition or a reboot from a
* server that doesn't support a grace period.
*/
restart:
spin_lock(&sp->so_lock);
write_seqcount_begin(&sp->so_reclaim_seqcount);
restart:
list_for_each_entry(state, &sp->so_states, open_states) {
if (!test_and_clear_bit(ops->state_flag_bit, &state->flags))
continue;
Expand All @@ -1412,6 +1414,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
}
spin_unlock(&state->state_lock);
nfs4_put_open_state(state);
spin_lock(&sp->so_lock);
goto restart;
}
}
Expand Down Expand Up @@ -1449,12 +1452,17 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
goto out_err;
}
nfs4_put_open_state(state);
spin_lock(&sp->so_lock);
goto restart;
}
write_seqcount_end(&sp->so_reclaim_seqcount);
spin_unlock(&sp->so_lock);
return 0;
out_err:
nfs4_put_open_state(state);
spin_lock(&sp->so_lock);
write_seqcount_end(&sp->so_reclaim_seqcount);
spin_unlock(&sp->so_lock);
return status;
}

Expand Down

0 comments on commit 4d37a48

Please sign in to comment.