https://github.com/torvalds/linux
Revision 8b1e2c50bce9f3cc4422c3ed087252b8347da77a authored by Linus Torvalds on 26 February 2021, 18:14:18 UTC, committed by Linus Torvalds on 26 February 2021, 18:14:18 UTC
Pull tracing fixes from Steven Rostedt:
 "Two fixes:

   - Fix an unsafe printf string usage in a kmem trace event

   - Fix spelling in output from the latency-collector tool"

* tag 'trace-v5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing/tools: fix a couple of spelling mistakes
  mm, tracing: Fix kmem_cache_free trace event to not print stale pointers
2 parent s 2bd3f4e + c1d96fa
Raw File
Tip revision: 8b1e2c50bce9f3cc4422c3ed087252b8347da77a authored by Linus Torvalds on 26 February 2021, 18:14:18 UTC
Merge tag 'trace-v5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Tip revision: 8b1e2c5
nfs4getroot.c
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*/

#include <linux/nfs_fs.h>
#include "nfs4_fs.h"
#include "internal.h"

#define NFSDBG_FACILITY		NFSDBG_CLIENT

int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh, bool auth_probe)
{
	struct nfs_fsinfo fsinfo;
	int ret = -ENOMEM;

	fsinfo.fattr = nfs_alloc_fattr();
	if (fsinfo.fattr == NULL)
		goto out;

	/* Start by getting the root filehandle from the server */
	ret = nfs4_proc_get_rootfh(server, mntfh, &fsinfo, auth_probe);
	if (ret < 0) {
		dprintk("nfs4_get_rootfh: getroot error = %d\n", -ret);
		goto out;
	}

	if (!(fsinfo.fattr->valid & NFS_ATTR_FATTR_TYPE)
			|| !S_ISDIR(fsinfo.fattr->mode)) {
		printk(KERN_ERR "nfs4_get_rootfh:"
		       " getroot encountered non-directory\n");
		ret = -ENOTDIR;
		goto out;
	}

	memcpy(&server->fsid, &fsinfo.fattr->fsid, sizeof(server->fsid));
out:
	nfs_free_fattr(fsinfo.fattr);
	return ret;
}
back to top