]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: reinstate clearing of *fhp in ll_create and don't allow fhp == NULL
authorJeff Layton <jlayton@redhat.com>
Mon, 19 Sep 2016 19:20:58 +0000 (15:20 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 19 Sep 2016 19:20:58 +0000 (15:20 -0400)
commit436b7a661f0c9c9e38b8184a18d437215d19c3ba
treec560dc5d732e19902f3e81d026f5177d8bd1bab6
parent0f9c4345196ad46b8cb64176c0835151072f6e2f
client: reinstate clearing of *fhp in ll_create and don't allow fhp == NULL

The logic in ll_create relies on *fhp being zeroed out on entry into the
function, but that's no longer being done since commit e08210dda. Fix
this by reinstating that initialization.

Luckily, it looks like the two main callers (FUSE and nfs-ganesha)
already handle this safely, but the SyntheticClient does not. Move the
zeroing of the pointer into ll_create, and allow callers to pass in a
pointer to an uninitialized value. With this, we can remove the
initialization in the fuse client code as well.

Also, we can get rid of some unneeded NULL pointer checks if we don't
allow callers to pass in a NULL fhp pointer. As best I can tell, no one
does that currently and no comments over ceph_ll_create seem to claim
that this should be allowed.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc
src/client/fuse_ll.cc