mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
xfs-quota: do not fail if user has no quota
XFS fails quotactl(Q_XGETQUOTA) with ENOENT if the user or group has no quota assigned to it. This is not an error condition - simply report 0 quota in this case. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
faaaae3c57
commit
ce82f66b9f
@ -90,16 +90,28 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
|
||||
DEBUG(10,("sys_get_xfs_quota: path[%s] bdev[%s] SMB_USER_QUOTA_TYPE uid[%u]\n",
|
||||
path, bdev, (unsigned)id.uid));
|
||||
|
||||
if ((ret=quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), bdev, id.uid, (caddr_t)&D)))
|
||||
ret=quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), bdev, id.uid, (caddr_t)&D);
|
||||
/* XFS fails with ENOENT if the user has no
|
||||
* quota. Our protocol in that case is to
|
||||
* succeed and return 0 as quota.
|
||||
*/
|
||||
if (ret != 0 && errno != ENOENT) {
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
#ifdef HAVE_GROUP_QUOTA
|
||||
case SMB_GROUP_QUOTA_TYPE:
|
||||
DEBUG(10,("sys_get_xfs_quota: path[%s] bdev[%s] SMB_GROUP_QUOTA_TYPE gid[%u]\n",
|
||||
path, bdev, (unsigned)id.gid));
|
||||
|
||||
if ((ret=quotactl(QCMD(Q_XGETQUOTA,GRPQUOTA), bdev, id.gid, (caddr_t)&D)))
|
||||
ret=quotactl(QCMD(Q_XGETQUOTA,GRPQUOTA), bdev, id.gid, (caddr_t)&D);
|
||||
/* XFS fails with ENOENT if the user has no
|
||||
* quota. Our protocol in that case is to
|
||||
* succeed and return 0 as quota.
|
||||
*/
|
||||
if (ret != 0 && errno != ENOENT) {
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
#endif /* HAVE_GROUP_QUOTA */
|
||||
case SMB_USER_FS_QUOTA_TYPE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user