diff options
-rw-r--r-- | fs/nfs/nfs4proc.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index afd61d72837d..d1c1016cd505 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1758,8 +1758,8 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta | |||
1758 | #if defined(CONFIG_NFS_V4_1) | 1758 | #if defined(CONFIG_NFS_V4_1) |
1759 | static int nfs41_check_expired_stateid(struct nfs4_state *state, nfs4_stateid *stateid, unsigned int flags) | 1759 | static int nfs41_check_expired_stateid(struct nfs4_state *state, nfs4_stateid *stateid, unsigned int flags) |
1760 | { | 1760 | { |
1761 | int status = NFS_OK; | ||
1762 | struct nfs_server *server = NFS_SERVER(state->inode); | 1761 | struct nfs_server *server = NFS_SERVER(state->inode); |
1762 | int status = -NFS4ERR_BAD_STATEID; | ||
1763 | 1763 | ||
1764 | if (state->flags & flags) { | 1764 | if (state->flags & flags) { |
1765 | status = nfs41_test_stateid(server, stateid); | 1765 | status = nfs41_test_stateid(server, stateid); |
@@ -1774,16 +1774,17 @@ static int nfs41_check_expired_stateid(struct nfs4_state *state, nfs4_stateid *s | |||
1774 | 1774 | ||
1775 | static int nfs41_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state) | 1775 | static int nfs41_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state) |
1776 | { | 1776 | { |
1777 | int deleg_status, open_status; | ||
1778 | int deleg_flags = 1 << NFS_DELEGATED_STATE; | 1777 | int deleg_flags = 1 << NFS_DELEGATED_STATE; |
1779 | int open_flags = (1 << NFS_O_RDONLY_STATE) | (1 << NFS_O_WRONLY_STATE) | (1 << NFS_O_RDWR_STATE); | 1778 | int open_flags = (1 << NFS_O_RDONLY_STATE) | (1 << NFS_O_WRONLY_STATE) | (1 << NFS_O_RDWR_STATE); |
1779 | int status; | ||
1780 | 1780 | ||
1781 | deleg_status = nfs41_check_expired_stateid(state, &state->stateid, deleg_flags); | 1781 | nfs41_check_expired_stateid(state, &state->stateid, deleg_flags); |
1782 | open_status = nfs41_check_expired_stateid(state, &state->open_stateid, open_flags); | 1782 | status = nfs41_check_expired_stateid(state, &state->open_stateid, |
1783 | open_flags); | ||
1783 | 1784 | ||
1784 | if ((deleg_status == NFS_OK) && (open_status == NFS_OK)) | 1785 | if (status != NFS_OK) |
1785 | return NFS_OK; | 1786 | status = nfs4_open_expired(sp, state); |
1786 | return nfs4_open_expired(sp, state); | 1787 | return status; |
1787 | } | 1788 | } |
1788 | #endif | 1789 | #endif |
1789 | 1790 | ||
@@ -4690,7 +4691,7 @@ out: | |||
4690 | #if defined(CONFIG_NFS_V4_1) | 4691 | #if defined(CONFIG_NFS_V4_1) |
4691 | static int nfs41_check_expired_locks(struct nfs4_state *state) | 4692 | static int nfs41_check_expired_locks(struct nfs4_state *state) |
4692 | { | 4693 | { |
4693 | int status, ret = NFS_OK; | 4694 | int status, ret = -NFS4ERR_BAD_STATEID; |
4694 | struct nfs4_lock_state *lsp; | 4695 | struct nfs4_lock_state *lsp; |
4695 | struct nfs_server *server = NFS_SERVER(state->inode); | 4696 | struct nfs_server *server = NFS_SERVER(state->inode); |
4696 | 4697 | ||
@@ -4716,9 +4717,9 @@ static int nfs41_lock_expired(struct nfs4_state *state, struct file_lock *reques | |||
4716 | 4717 | ||
4717 | if (test_bit(LK_STATE_IN_USE, &state->flags)) | 4718 | if (test_bit(LK_STATE_IN_USE, &state->flags)) |
4718 | status = nfs41_check_expired_locks(state); | 4719 | status = nfs41_check_expired_locks(state); |
4719 | if (status == NFS_OK) | 4720 | if (status != NFS_OK) |
4720 | return status; | 4721 | status = nfs4_lock_expired(state, request); |
4721 | return nfs4_lock_expired(state, request); | 4722 | return status; |
4722 | } | 4723 | } |
4723 | #endif | 4724 | #endif |
4724 | 4725 | ||