diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2015-09-17 13:58:24 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-10-23 21:57:32 +0200 |
commit | cc8a55320b5f1196bee5bd14e4bb2ebd3b983317 (patch) | |
tree | d5b6e13f764cc2c0a37d8676662302e09e1ec020 /mm | |
parent | nfsd: improve client_has_state to check for unused openowners (diff) | |
download | linux-cc8a55320b5f1196bee5bd14e4bb2ebd3b983317.tar.xz linux-cc8a55320b5f1196bee5bd14e4bb2ebd3b983317.zip |
nfsd: serialize layout stateid morphing operations
In order to allow the client to make a sane determination of what
happened with racing LAYOUTGET/LAYOUTRETURN/CB_LAYOUTRECALL calls, we
must ensure that the seqids return accurately represent the order of
operations. The simplest way to do that is to ensure that operations on
a single stateid are serialized.
This patch adds a mutex to the layout stateid, and locks it when
checking the layout stateid's seqid. The mutex is held over the entire
operation and released after the seqid is bumped.
Note that in the case of CB_LAYOUTRECALL we must move the increment of
the seqid and setting into a new cb "prepare" operation. The lease
infrastructure will call the lm_break callback with a spinlock held, so
and we can't take the mutex in that codepath.
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions