Closed cocalele closed 2 years ago
Though not totally understand ganesha mechanism on using state
in open, I guess a state
should be valid for an unique object_handle
. There may be something wrong make ganesha treat the handle different as an existing one.
At last I found the function package_mem_handle
, it use field in object_handle to form a unique identifier.
Then obj_handle.fileid
was found initialized wrong.
static struct mem_fsal_obj_handle * _mem_alloc_handle()
{
struct mem_fsal_obj_handle *hdl;
size_t isize;
hdl->obj_handle.fileid = atomic_postinc_uint64_t(&mem_inode_number); //that's the legacy code inherited from fsal_mem
hdl->obj_handle.fileid = inode->i_no; //for ViveNAS should use correct inode number
}
after correcting the error in alloc_handle, this bug disappears.
a new state object is allocated on each time the file is opened.
Segfault encountered in file
mem_write2
because the ViveFile* was NULL in the object handle asked to write.We have the following structure for ViveNAS open:
In open2 function, the logic is as following :
The
open2
function was called withThat's to say the state was used as fd and opened, and we not touch the
fd
in input paramobj_handle
was not touched.