diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-29 18:30:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-29 18:30:26 -0400 |
commit | e7bdea7750eb2a64aea4a08fa5c0a31719c8155d (patch) | |
tree | 1a4bb5307a59a21269f045c69695dbbd811de79f /fs/nfs/nfs4proc.c | |
parent | 89a82a9218fabd753979847f494565f1fa91d7a8 (diff) | |
parent | e547f2628327fec6afd2e03b46f113f614cca05b (diff) |
Merge tag 'nfs-for-4.7-2' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client bugfixes from Anna Schumaker:
"Stable bugfixes:
- Fix _cancel_empty_pagelist
- Fix a double page unlock
- Make nfs_atomic_open() call d_drop() on all ->open_context() errors.
- Fix another OPEN_DOWNGRADE bug
Other bugfixes:
- Ensure we handle delegation errors in nfs4_proc_layoutget()
- Layout stateids start out as being invalid
- Add sparse lock annotations for pnfs_find_alloc_layout
- Handle bad delegation stateids in nfs4_layoutget_handle_exception
- Fix up O_DIRECT results
- Fix potential use after free of state in nfs4_do_reclaim.
- Mark the layout stateid invalid when all segments are removed
- Don't let readdirplus revalidate an inode that was marked as stale
- Fix potential race in nfs_fhget()
- Fix an unused variable warning"
* tag 'nfs-for-4.7-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
NFS: Fix another OPEN_DOWNGRADE bug
make nfs_atomic_open() call d_drop() on all ->open_context() errors.
NFS: Fix an unused variable warning
NFS: Fix potential race in nfs_fhget()
NFS: Don't let readdirplus revalidate an inode that was marked as stale
NFSv4.1/pnfs: Mark the layout stateid invalid when all segments are removed
NFS: Fix a double page unlock
pnfs_nfs: fix _cancel_empty_pagelist
nfs4: Fix potential use after free of state in nfs4_do_reclaim.
NFS: Fix up O_DIRECT results
NFS/pnfs: handle bad delegation stateids in nfs4_layoutget_handle_exception
NFSv4.1/pnfs: Add sparse lock annotations for pnfs_find_alloc_layout
NFSv4.1/pnfs: Layout stateids start out as being invalid
NFSv4.1/pnfs: Ensure we handle delegation errors in nfs4_proc_layoutget()
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index de97567795a5..ff416d0e24bc 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2882,12 +2882,11 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) | |||
2882 | call_close |= is_wronly; | 2882 | call_close |= is_wronly; |
2883 | else if (is_wronly) | 2883 | else if (is_wronly) |
2884 | calldata->arg.fmode |= FMODE_WRITE; | 2884 | calldata->arg.fmode |= FMODE_WRITE; |
2885 | if (calldata->arg.fmode != (FMODE_READ|FMODE_WRITE)) | ||
2886 | call_close |= is_rdwr; | ||
2885 | } else if (is_rdwr) | 2887 | } else if (is_rdwr) |
2886 | calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; | 2888 | calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; |
2887 | 2889 | ||
2888 | if (calldata->arg.fmode == 0) | ||
2889 | call_close |= is_rdwr; | ||
2890 | |||
2891 | if (!nfs4_valid_open_stateid(state)) | 2890 | if (!nfs4_valid_open_stateid(state)) |
2892 | call_close = 0; | 2891 | call_close = 0; |
2893 | spin_unlock(&state->owner->so_lock); | 2892 | spin_unlock(&state->owner->so_lock); |
@@ -7924,8 +7923,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, | |||
7924 | break; | 7923 | break; |
7925 | } | 7924 | } |
7926 | lo = NFS_I(inode)->layout; | 7925 | lo = NFS_I(inode)->layout; |
7927 | if (lo && nfs4_stateid_match(&lgp->args.stateid, | 7926 | if (lo && !test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) && |
7928 | &lo->plh_stateid)) { | 7927 | nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) { |
7929 | LIST_HEAD(head); | 7928 | LIST_HEAD(head); |
7930 | 7929 | ||
7931 | /* | 7930 | /* |
@@ -7936,10 +7935,10 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, | |||
7936 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0); | 7935 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0); |
7937 | spin_unlock(&inode->i_lock); | 7936 | spin_unlock(&inode->i_lock); |
7938 | pnfs_free_lseg_list(&head); | 7937 | pnfs_free_lseg_list(&head); |
7938 | status = -EAGAIN; | ||
7939 | goto out; | ||
7939 | } else | 7940 | } else |
7940 | spin_unlock(&inode->i_lock); | 7941 | spin_unlock(&inode->i_lock); |
7941 | status = -EAGAIN; | ||
7942 | goto out; | ||
7943 | } | 7942 | } |
7944 | 7943 | ||
7945 | status = nfs4_handle_exception(server, status, exception); | 7944 | status = nfs4_handle_exception(server, status, exception); |
@@ -8036,7 +8035,10 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout, gfp_t gfp_flags) | |||
8036 | .flags = RPC_TASK_ASYNC, | 8035 | .flags = RPC_TASK_ASYNC, |
8037 | }; | 8036 | }; |
8038 | struct pnfs_layout_segment *lseg = NULL; | 8037 | struct pnfs_layout_segment *lseg = NULL; |
8039 | struct nfs4_exception exception = { .timeout = *timeout }; | 8038 | struct nfs4_exception exception = { |
8039 | .inode = inode, | ||
8040 | .timeout = *timeout, | ||
8041 | }; | ||
8040 | int status = 0; | 8042 | int status = 0; |
8041 | 8043 | ||
8042 | dprintk("--> %s\n", __func__); | 8044 | dprintk("--> %s\n", __func__); |