Skip to content

Commit

Permalink
daemon: Fix drmemory hits when processing NFSv4 referrals
Browse files Browse the repository at this point in the history
Fix two drmemory hits when processing NFSv4 referrals:
---- snip ----
Error #1: UNINITIALIZED READ: reading 8 byte(s)
 0 path_fh_copy               [ms-nfs41-client\daemon\util.c:468]
 1 server_lookup              [ms-nfs41-client\daemon\lookup.c:259]
 2 server_lookup_loop         [ms-nfs41-client\daemon\lookup.c:360]
 3 nfs41_lookup               [ms-nfs41-client\daemon\lookup.c:512]
 4 lookup_entry               [ms-nfs41-client\daemon\readdir.c:468]
 5 readdir_copy_entry         [ms-nfs41-client\daemon\readdir.c:534]
 6 handle_readdir             [ms-nfs41-client\daemon\readdir.c:800]
 7 upcall_handle              [ms-nfs41-client\daemon\upcall.c:220]
 8 nfsd_worker_thread_main    [ms-nfs41-client\daemon\nfs41_daemon.c:201]
 9 nfsd_thread_main           [ms-nfs41-client\daemon\nfs41_daemon.c:239]
10 KERNEL32.dll!BaseThreadInitThunk +0x13 (0x00007ffadccb7374 <KERNEL32.dll+0x17374>)

Error #2: UNINITIALIZED READ: reading 8 byte(s)
 0 path_fh_copy               [ms-nfs41-client\daemon\util.c:470]
 1 server_lookup              [ms-nfs41-client\daemon\lookup.c:259]
 2 server_lookup_loop         [ms-nfs41-client\daemon\lookup.c:360]
 3 nfs41_lookup               [ms-nfs41-client\daemon\lookup.c:512]
 8 readdir_copy_entry         [ms-nfs41-client\daemon\readdir.c:534]
 9 handle_readdir             [ms-nfs41-client\daemon\readdir.c:800]
10 upcall_handle              [ms-nfs41-client\daemon\upcall.c:220]
11 nfsd_worker_thread_main    [ms-nfs41-client\daemon\nfs41_daemon.c:201]
12 nfsd_thread_main           [ms-nfs41-client\daemon\nfs41_daemon.c:239]
---- snip ----

Reported-by: Cedric Blancher <[email protected]>
Signed-off-by: Cedric Blancher <[email protected]>
Signed-off-by: Tigran Mkrtchyan <[email protected]>
  • Loading branch information
gisburn authored and kofemann committed Oct 23, 2024
1 parent ac4f704 commit 3bd2690
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions daemon/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,15 @@ int nfs41_lookup(
OUT OPTIONAL nfs41_path_fh *target_out,
OUT OPTIONAL nfs41_file_info *info_out,
OUT nfs41_session **session_out)
{
nfs41_abs_path path;
struct nfs41_name_cache *cache = session_name_cache(session);
nfs41_path_fh parent, target, *server_start;
const char *path_pos, *path_end;
struct lookup_referral referral;
bool_t negative = 0;
int status;

{
nfs41_abs_path path;
struct nfs41_name_cache *cache = session_name_cache(session);
nfs41_path_fh parent = { 0 }, target = { 0 }, *server_start;
const char *path_pos, *path_end;
struct lookup_referral referral = { 0 };
bool_t negative = 0;
int status;

if (session_out) *session_out = session;

InitializeSRWLock(&path.lock);
Expand Down
8 changes: 4 additions & 4 deletions daemon/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ int nfs41_root_mount_addrs(
* used for the RPC call. */
static int referral_mount_location(
IN nfs41_root *root,
IN const fs_location4 *loc,
OUT nfs41_client **client_out)
{
multi_addr4 addrs;
IN const fs_location4 *loc,
OUT nfs41_client **client_out)
{
multi_addr4 addrs = { 0 };
int status = ERROR_BAD_NET_NAME;
uint32_t i;

Expand Down

0 comments on commit 3bd2690

Please sign in to comment.