FSAL_VFS: fix segfault when export two subdirs with FSAL_VFS and FSAL_XFS

I export 2 subdirs /dir1, /dir2 of a xfs filesystem, /dir1 with FSAL_XFS
and /dir2 with FSAL_VFS. This export behavior results with only /dir1
exported successfully which is expected.
But when I try to do 'systemctl stop nfs-ganesha', I got a segfault:

kernel: ganesha.nfsd[58288]: segfault at 7f757901a340 ip 00007f757901a340 \
sp 00007f74ef4e94b8 error 15

This is because the failed export of /dir2 forgets to cleanup the export
entry of the FSAL_VFS module upon failure, and the destroy_fsals() got
bad pointers.

Adding a detach_export will fix it.
I tried to clarify the err return paths at the same time.

Change-Id: I02b91e19c789bbf34a8aeda14c3a3faba814bc8b
Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
1 file changed
tree: 763cd12912289a9ab850e39f04c6a8104a83fa42
  1. contrib/
  2. coverity/
  3. jenkins/
  4. src/
  5. .gitignore
  6. .gitmodules
  7. .gitreview
  8. .mailmap
  9. .travis.yml
  10. README.md
README.md

Coverity Scan Build Status nfs-ganesha

NFS-Ganesha is an NFSv3,v4,v4.1 fileserver that runs in user mode on most UNIX/Linux systems. It also supports the 9p.2000L protocol.

For more information, consult the project wiki.