Skip to content

Commit

Permalink
NFS: Handle exceptions coming out of nfs4_proc_fs_locations()
Browse files Browse the repository at this point in the history
We don't want to return -NFS4ERR_WRONGSEC to the VFS because it could
cause the kernel to oops.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Bryan Schumaker authored and Trond Myklebust committed Apr 27, 2012
1 parent 31e4dda commit db0a959
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4921,7 +4921,7 @@ static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr)
fattr->nlink = 2;
}

int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
static int _nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
struct nfs4_fs_locations *fs_locations, struct page *page)
{
struct nfs_server *server = NFS_SERVER(dir);
Expand Down Expand Up @@ -4961,6 +4961,19 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
return status;
}

int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
struct nfs4_fs_locations *fs_locations, struct page *page)
{
struct nfs4_exception exception = { };
int err;
do {
err = nfs4_handle_exception(NFS_SERVER(dir),
_nfs4_proc_fs_locations(dir, name, fs_locations, page),
&exception);
} while (exception.retry);
return err;
}

static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors)
{
int status;
Expand Down

0 comments on commit db0a959

Please sign in to comment.