diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-06-29 18:45:53 +0200 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-07-26 22:25:25 +0200 |
commit | af9b6d7570ca9afbbc6076ab7920d8f00f7e55c1 (patch) | |
tree | 4fbc674f3e1e9b1218a8d028132376ca2ea9e477 /fs/nfs/nfs4proc.c | |
parent | NFS: Allow optimisation of lseek(fd, SEEK_CUR, 0) on directories (diff) | |
download | linux-af9b6d7570ca9afbbc6076ab7920d8f00f7e55c1.tar.xz linux-af9b6d7570ca9afbbc6076ab7920d8f00f7e55c1.zip |
pNFS: Parse the results of layoutget on open even if permissions checks fail
Even if the results of the permissions checks failed, we should parse
the results of the layout on open call so that we can return the
layout if required.
Note that we also want to ignore the sequence counter for whether or not
a layout recall occurred. If the recall pertained to our OPEN, then the
callback will know, and will attempt to wait for us to finih processing
anyway.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6dd146885da9..5a8190ec31a2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2843,6 +2843,9 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, nfs_save_change_attribute(d_inode(opendata->dir))); } + /* Parse layoutget results before we check for access */ + pnfs_parse_lgopen(state->inode, opendata->lgp, ctx); + ret = nfs4_opendata_access(sp->so_cred, opendata, state, fmode, flags); if (ret != 0) goto out; @@ -2851,8 +2854,6 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, nfs_inode_attach_open_context(ctx); if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) nfs4_schedule_stateid_recovery(server, state); - else - pnfs_parse_lgopen(state->inode, opendata->lgp, ctx); } out: |