Merge commit 'ccbf62d8a284cf181ac28c8e8407dd077d90dd4b' into for-next
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_qm_syscalls.c
index 72cbe65e5e75ed05b97f9aeab294d394713dc9da..bbc813caba4c88b28df1e5710146aa1095629500 100644 (file)
@@ -278,9 +278,10 @@ xfs_qm_scall_trunc_qfiles(
        xfs_mount_t     *mp,
        uint            flags)
 {
-       int             error;
+       int             error = EINVAL;
 
-       if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
+       if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0 ||
+           (flags & ~XFS_DQ_ALLTYPES)) {
                xfs_debug(mp, "%s: flags=%x m_qflags=%x",
                        __func__, flags, mp->m_qflags);
                return XFS_ERROR(EINVAL);