Jim Chen has uploaded this change for review.
FSAL_VFS: fix inverted my_fd cleanup condition in vfs_open2 fileerr
In vfs_open2(), the fileerr: cleanup label checks
if (my_fd == &hdl->u.file.fd) before calling close(fd), which is
inverted relative to (*new_obj)->obj_ops->release(*new_obj) closing
hdl->u.file.fd. When hdl is NULL or state != NULL, fd is leaked on
error; when hdl != NULL and state == NULL, fd is closed twice.
Close fd in fileerr: when hdl == NULL or my_fd != &hdl->u.file.fd
and reset my_fd->fd = -1 and openflags = FSAL_O_CLOSED.
Change-Id: I5f866cbae2e4317ccf8f3f80b7b42de666488335
Signed-off-by: Jim Chen <czcbangkai@google.com>
---
M src/FSAL/FSAL_VFS/file.c
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/32/1256832/1
To view, visit change 1256832. To unsubscribe, or for help writing mail filters, visit settings.