Skip to content

Conversation

@Vigilans
Copy link

This PR fixes several problematic behaviors related to nfs feature:

  1. Since rpc (tirpc or rpcsvc) is only used in NFS related code, it should not be linked if nfs feature is not enabled. This reduced the size and dependency and possible build errors for webdav-server-rs binary.
  2. When nfs feature is disabled, we should not use fs_quota_linux to try fetching quota for NFS filesystem. It will return error code -1 with message Block device required (os error 15), instead of 1. Therefore FqError::NoQuota will not be returned, so FsQuota::system not tried.
  3. When nfs feature is enabled, we should try FsQuota::system as possible if quota_nfs::get_quota is failed. In my case quota_nfs::get_quota never worked but libc::statvfs always works. So, we should try as possible to use libc::statvfs for NFS as a fallback way.

quota_nfs::get_quota failed in different way in my environment:

  1. In arch linux host with gnu-gcc: nfs: clnt_create error is triggered, returning FqError::Other. In this case Fix 3 would fix the problem.
  2. In alpine docker with musl-gcc: when calling clnt_create, a Segmentation fault is triggered, making the thread quitted immediately, let along the code trying to call FsQuota::system. Fix 2 would fix the problem.

Therefore in my case, disabling nfs feature to use libc::statvfs would be a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant