diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
commit | bf97293eb878df3792d9de7213bd7b82135aea77 (patch) | |
tree | 16cb367bd78095b9eb8a54c800fcddfcccb618c7 /fs/nfs/pagelist.c | |
parent | 16d70e15295953b19ecf59e943723a181782b856 (diff) | |
parent | b1b3e136948a2bf4915326acb0d825d7d180753f (diff) |
Merge tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights include:
- Fix NFSv4 recovery so that it doesn't recover lost locks in cases
such as lease loss due to a network partition, where doing so may
result in data corruption. Add a kernel parameter to control
choice of legacy behaviour or not.
- Performance improvements when 2 processes are writing to the same
file.
- Flush data to disk when an RPCSEC_GSS session timeout is imminent.
- Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other
NFS clients from being able to manipulate our lease and file
locking state.
- Allow sharing of RPCSEC_GSS caches between different rpc clients.
- Fix the broken NFSv4 security auto-negotiation between client and
server.
- Fix rmdir() to wait for outstanding sillyrename unlinks to complete
- Add a tracepoint framework for debugging NFSv4 state recovery
issues.
- Add tracing to the generic NFS layer.
- Add tracing for the SUNRPC socket connection state.
- Clean up the rpc_pipefs mount/umount event management.
- Merge more patches from Chuck in preparation for NFSv4 migration
support"
* tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits)
NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity
NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
NFSv4: Allow security autonegotiation for submounts
NFSv4: Disallow security negotiation for lookups when 'sec=' is specified
NFSv4: Fix security auto-negotiation
NFS: Clean up nfs_parse_security_flavors()
NFS: Clean up the auth flavour array mess
NFSv4.1 Use MDS auth flavor for data server connection
NFS: Don't check lock owner compatability unless file is locked (part 2)
NFS: Don't check lock owner compatibility in writes unless file is locked
nfs4: Map NFS4ERR_WRONG_CRED to EPERM
nfs4.1: Add SP4_MACH_CRED write and commit support
nfs4.1: Add SP4_MACH_CRED stateid support
nfs4.1: Add SP4_MACH_CRED secinfo support
nfs4.1: Add SP4_MACH_CRED cleanup support
nfs4.1: Add state protection handler
nfs4.1: Minimal SP4_MACH_CRED implementation
SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
SUNRPC: Add an identifier for struct rpc_clnt
SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints
...
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 29cfb7ade121..2ffebf2081ce 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -328,6 +328,19 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | |||
328 | } | 328 | } |
329 | EXPORT_SYMBOL_GPL(nfs_pageio_init); | 329 | EXPORT_SYMBOL_GPL(nfs_pageio_init); |
330 | 330 | ||
331 | static bool nfs_match_open_context(const struct nfs_open_context *ctx1, | ||
332 | const struct nfs_open_context *ctx2) | ||
333 | { | ||
334 | return ctx1->cred == ctx2->cred && ctx1->state == ctx2->state; | ||
335 | } | ||
336 | |||
337 | static bool nfs_match_lock_context(const struct nfs_lock_context *l1, | ||
338 | const struct nfs_lock_context *l2) | ||
339 | { | ||
340 | return l1->lockowner.l_owner == l2->lockowner.l_owner | ||
341 | && l1->lockowner.l_pid == l2->lockowner.l_pid; | ||
342 | } | ||
343 | |||
331 | /** | 344 | /** |
332 | * nfs_can_coalesce_requests - test two requests for compatibility | 345 | * nfs_can_coalesce_requests - test two requests for compatibility |
333 | * @prev: pointer to nfs_page | 346 | * @prev: pointer to nfs_page |
@@ -343,13 +356,10 @@ static bool nfs_can_coalesce_requests(struct nfs_page *prev, | |||
343 | struct nfs_page *req, | 356 | struct nfs_page *req, |
344 | struct nfs_pageio_descriptor *pgio) | 357 | struct nfs_pageio_descriptor *pgio) |
345 | { | 358 | { |
346 | if (req->wb_context->cred != prev->wb_context->cred) | 359 | if (!nfs_match_open_context(req->wb_context, prev->wb_context)) |
347 | return false; | ||
348 | if (req->wb_lock_context->lockowner.l_owner != prev->wb_lock_context->lockowner.l_owner) | ||
349 | return false; | ||
350 | if (req->wb_lock_context->lockowner.l_pid != prev->wb_lock_context->lockowner.l_pid) | ||
351 | return false; | 360 | return false; |
352 | if (req->wb_context->state != prev->wb_context->state) | 361 | if (req->wb_context->dentry->d_inode->i_flock != NULL && |
362 | !nfs_match_lock_context(req->wb_lock_context, prev->wb_lock_context)) | ||
353 | return false; | 363 | return false; |
354 | if (req->wb_pgbase != 0) | 364 | if (req->wb_pgbase != 0) |
355 | return false; | 365 | return false; |