Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175974
b: refs/heads/master
c: 0629e37
h: refs/heads/master
v: v3
  • Loading branch information
Alexandros Batsakis authored and Trond Myklebust committed Dec 5, 2009
1 parent b630aa8 commit b744147
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 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: 2449ea2e191123729b2dc37a06fcb9d6ea7e2736
refs/heads/master: 0629e370dd5819efa5cf8d418a8e6729efe388ef
1 change: 1 addition & 0 deletions trunk/fs/nfs/nfs4_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t);
extern void nfs4_schedule_state_recovery(struct nfs_client *);
extern void nfs4_schedule_state_manager(struct nfs_client *);
extern int nfs4_state_mark_reclaim_nograce(struct nfs_client *clp, struct nfs4_state *state);
extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags);
extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp);
extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl);
extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t);
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ static void nfs41_sequence_done(struct nfs_client *clp,
if (time_before(clp->cl_last_renewal, timestamp))
clp->cl_last_renewal = timestamp;
spin_unlock(&clp->cl_lock);
/* Check sequence flags */
nfs41_handle_sequence_flag_errors(clp, res->sr_status_flags);
return;
}
out:
Expand Down
22 changes: 22 additions & 0 deletions trunk/fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,28 @@ static int nfs4_reclaim_lease(struct nfs_client *clp)
}

#ifdef CONFIG_NFS_V4_1
void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags)
{
if (!flags)
return;
else if (flags & SEQ4_STATUS_RESTART_RECLAIM_NEEDED) {
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
nfs4_state_start_reclaim_reboot(clp);
nfs4_schedule_state_recovery(clp);
} else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |
SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED |
SEQ4_STATUS_ADMIN_STATE_REVOKED |
SEQ4_STATUS_RECALLABLE_STATE_REVOKED |
SEQ4_STATUS_LEASE_MOVED)) {
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
nfs4_state_start_reclaim_nograce(clp);
nfs4_schedule_state_recovery(clp);
} else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |
SEQ4_STATUS_BACKCHANNEL_FAULT |
SEQ4_STATUS_CB_PATH_DOWN_SESSION))
nfs_expire_all_delegations(clp);
}

static void nfs4_session_recovery_handle_error(struct nfs_client *clp, int err)
{
switch (err) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4614,8 +4614,8 @@ static int decode_sequence(struct xdr_stream *xdr,
dummy = be32_to_cpup(p++);
/* target highest slot id - currently not processed */
dummy = be32_to_cpup(p++);
/* result flags - currently not processed */
dummy = be32_to_cpup(p);
/* result flags */
res->sr_status_flags = be32_to_cpup(p);
status = 0;
out_err:
res->sr_status = status;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/nfs4.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
#define SEQ4_STATUS_LEASE_MOVED 0x00000080
#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
#define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200
#define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400

#define NFS4_MAX_UINT64 (~(u64)0)

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/nfs_xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ struct nfs4_sequence_res {
u8 sr_slotid; /* slot used to send request */
int sr_status; /* sequence operation status */
unsigned long sr_renewal_time;
u32 sr_status_flags;
};

struct nfs4_get_lease_time_args {
Expand Down

0 comments on commit b744147

Please sign in to comment.