summaryrefslogtreecommitdiff
path: root/quotaio_xfs.c
Commit message (Collapse)AuthorAgeFilesLines
* quotaio_xfs: Warn when large kernel timestamps cannot be handledJan Kara2020-11-241-0/+9
| | | | | | | | | | | When time_t is 32-bit, warn if the kernel returns anything that cannot fit in these time stamps. This also fixes a compilation warning that shift exceeds data type size. Similarly when converting data to pass to kernel, just avoid the pointless shift (generating compiler warning) when time_t is 32-bit. Reported-by: "Dmitry V. Levin" <ldv@altlinux.org> Signed-off-by: Jan Kara <jack@suse.cz>
* Handle grace time overflows for XFS quotasJan Kara2020-09-211-9/+17
| | | | | | | Add checks and error handling to report when grace times set for XFS quotas would overflow. Signed-off-by: Jan Kara <jack@suse.cz>
* Support grace period expirations past y2038 for XFSDarrick J. Wong2020-09-071-4/+29
| | | | | | | | Add the ability to interpret the larger quota grace period expiration timestamps that the kernel can export via struct xfs_kern_dqblk. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Fix limits setting on XFS filesystemJan Kara2020-05-211-1/+3
| | | | | | | | | | | | | | xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't support setting of anything else for XFS but now that kernel will start supporting setting of grace times for XFS, we need to be more careful and set limits bits only if we really want to update them. Also FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools currently don't support them in any way so avoid telling kernel to set them. Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
* quota-tools: Set FS_DQ_TIMER_MASK for individual xfs grace timesEric Sandeen2020-05-141-0/+2
| | | | | | | | | | | | xfs quota code doesn't currently allow increasing an individual user's grace time, but kernel patches are in development for this. In order for setquota to be able to send this update via setquota -T, we need to add the FS_DQ_TIMER_MASK when we are trying to update the grace times on an individual user's dquot. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
* quota-tools: pass quota type to QCMD for Q_XFS_GETQSTATEric Sandeen2020-05-131-1/+1
| | | | | | | | | | | | | | | | Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned timer information for the first quota type which was found to be enabled. As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") the kernel now honors the quota type requested, so send that from the Q_XFS_GETQSTAT calls in quota tools. Older kernels ignore the type altogether, so this change should be backwards compatible with no change in behavior. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
* repquota: Fix output when user -2 existsJan Kara2018-01-101-0/+5
| | | | | | | | | | | | | Vladimit Meshkov reported that when user -2 exists and user namespaces are enabled in the kernel, repquota(8) fails to output anything. He also analyzed this is because in such case repquota(8) tries to query info for user -1 which is invalid ID, gets error from the kernel, and bails out. Fix the problem by stopping iteration over IDs when we reach ID -1. Reported-by: Vladimir Meshkov <ubob74@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Add support for project quota into generic codeJan Kara2016-03-311-8/+36
| | | | | | | | | | | The support for project quota in generic code is simple. We just need functions to convert project ID to project name and back (we follow what xfsprogs do in that regard), add detection whether project quota is enabled for the filesystem, and increase number of quota types. We also have to update various checks to count with project quotas. Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Add support for scanning using Q_XGETNEXTQUOTAJan Kara2016-01-271-3/+39
| | | | | | | Add support for scanning of all available quota structures using Q_XGETNEXTQUOTA quotactl. Signed-off-by: Jan Kara <jack@suse.cz>
* repquota: Fix reporting for XFSJan Kara2012-06-081-2/+2
| | | | | | | | | | Conversion to generic quota scanning introduced a bug for XFS where we stopped scanning after quotactl reported first error. quotactl for XFS however reports ENOENT when it has nothing to report for a particular user / group and we shouldn't stop scanning after that. We tried to test for this but the test was wrong. Fix it. Signed-off-by: Jan Kara <jack@suse.cz>
* Implement repquota for filesystems without quota filesJan Kara2011-05-051-52/+16
| | | | | | | | | | Some filesystem do not have quota files accessible from userspace. For these implementing ->scan_dquots() used by repquota is problematic. What we do is that we iterate over all users and ask for quota information for each of them. XFS already does this so make its code generic and use it for all filesystems using quotaio_meta.c - only OCFS2 these days. Signed-off-by: Jan Kara <jack@suse.cz>
* Implement quotacheck for GFS2Abhijith Das2011-02-041-1/+11
| | | | | | | | Although GFS2 maintains quota as metadata, it sometimes might need to check quota usage (most notably when quota is enabled for the first time). So add support for GFS2 in quotacheck. Signed-off-by: Jan Kara <jack@suse.cz>
* * Rewritten configuration script to create config.h (Jan Kara)jkar85722010-01-051-0/+1
| | | | | * Use /proc/mounts for mountpoint scanning (Jan Kara) * Removed use of reserved identifiers (Jan Kara)
* 64-bit quota support.jkar85722009-12-141-1/+1
|
* Format string fixes (Ladislav Michnovic)jkar85722008-04-211-2/+2
|
* Implemented setting only limits by commit_dquot() so edquota & setquota can ↵jkar85722001-09-271-2/+2
| | | | | | operate safe on live filesystem.
* Fixed overflow of used space.jkar85722001-07-171-1/+1
|
* Fixed infinity loop for XFS repquota.jkar85722001-05-041-6/+9
|
* Updated manpages.jkar85722001-04-111-9/+5
| | | | | | Fixed small bug in repquota (User vs Group). Some XFS updates. Fixed problems with devfs and relative paths.
* Changed callbacks initialization to label-like one.jkar85722001-03-261-8/+6
|
* Fixed bugs in XFS quota option detection.jkar85722001-03-261-0/+18
|
* Initial revisionjkar85722001-03-231-0/+277