|
|
eb602e4 |
Backport of patch from #547748 that is already in upstream.
|
|
|
eb602e4 |
Original patch adds some GFS checks to XFS checks in create_handle_list(),
|
|
|
eb602e4 |
but current RHEL-6 does not contain the checks for fro XFS. So ommiting them.
|
|
|
eb602e4 |
|
|
|
eb602e4 |
diff --git a/mntopt.h b/mntopt.h
|
|
|
eb602e4 |
index ee375c4..1730340 100644
|
|
|
eb602e4 |
--- a/mntopt.h
|
|
|
eb602e4 |
+++ b/mntopt.h
|
|
|
eb602e4 |
@@ -18,6 +18,7 @@
|
|
|
eb602e4 |
#define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */
|
|
|
eb602e4 |
#define MNTTYPE_MPFS "mpfs" /* EMC Celerra MPFS filesystem */
|
|
|
eb602e4 |
#define MNTTYPE_OCFS2 "ocfs2" /* Oracle Cluster filesystem */
|
|
|
eb602e4 |
+#define MNTTYPE_GFS2 "gfs2" /* Red Hat Global filesystem 2 */
|
|
|
eb602e4 |
|
|
|
eb602e4 |
/* mount options */
|
|
|
eb602e4 |
#define MNTOPT_NOQUOTA "noquota" /* don't enforce quota */
|
|
|
eb602e4 |
diff --git a/quotacheck.c b/quotacheck.c
|
|
|
eb602e4 |
index b5f7e2e..3c56eee 100644
|
|
|
eb602e4 |
--- a/quotacheck.c
|
|
|
eb602e4 |
+++ b/quotacheck.c
|
|
|
eb602e4 |
@@ -1048,7 +1048,9 @@ static void check_all(void)
|
|
|
eb602e4 |
while ((mnt = get_next_mount())) {
|
|
|
eb602e4 |
if (flags & FL_ALL && flags & FL_NOROOT && !strcmp(mnt->mnt_dir, "/"))
|
|
|
eb602e4 |
continue;
|
|
|
eb602e4 |
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || nfs_fstype(mnt->mnt_type) ||
|
|
|
eb602e4 |
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
|
|
|
eb602e4 |
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2) ||
|
|
|
eb602e4 |
+ nfs_fstype(mnt->mnt_type) ||
|
|
|
eb602e4 |
meta_qf_fstype(mnt->mnt_type)) {
|
|
|
eb602e4 |
debug(FL_DEBUG | FL_VERBOSE, _("Skipping %s [%s]\n"), mnt->mnt_fsname, mnt->mnt_dir);
|
|
|
eb602e4 |
continue;
|
|
|
eb602e4 |
diff --git a/quotaio.c b/quotaio.c
|
|
|
eb602e4 |
index d74a37d..0dd8324 100644
|
|
|
eb602e4 |
--- a/quotaio.c
|
|
|
eb602e4 |
+++ b/quotaio.c
|
|
|
eb602e4 |
@@ -73,7 +73,8 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags)
|
|
|
eb602e4 |
#endif
|
|
|
eb602e4 |
}
|
|
|
eb602e4 |
|
|
|
eb602e4 |
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem? */
|
|
|
eb602e4 |
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || /* XFS filesystem? */
|
|
|
eb602e4 |
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { /* XFS filesystem? */
|
|
|
eb602e4 |
if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */
|
|
|
eb602e4 |
errstr(_("Only XFS quota format is allowed on XFS filesystem.\n"));
|
|
|
eb602e4 |
goto out_handle;
|
|
|
eb602e4 |
diff --git a/quotaon.c b/quotaon.c
|
|
|
eb602e4 |
index eafadef..0e6e363 100644
|
|
|
eb602e4 |
--- a/quotaon.c
|
|
|
eb602e4 |
+++ b/quotaon.c
|
|
|
eb602e4 |
@@ -163,7 +163,10 @@ static int newstate(struct mntent *mnt, int type, char *extra)
|
|
|
eb602e4 |
if (flags & FL_ALL)
|
|
|
eb602e4 |
sflags |= STATEFLAG_ALL;
|
|
|
eb602e4 |
|
|
|
eb602e4 |
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */
|
|
|
eb602e4 |
+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) {
|
|
|
eb602e4 |
+ errstr(_("Cannot change state of GFS2 quota.\n"));
|
|
|
eb602e4 |
+ return 1;
|
|
|
eb602e4 |
+ } else if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */
|
|
|
eb602e4 |
if (!(kernel_formats & (1 << QF_XFS))) {
|
|
|
eb602e4 |
errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n"));
|
|
|
eb602e4 |
return 1;
|
|
|
eb602e4 |
@@ -200,7 +203,8 @@ static int print_state(struct mntent *mnt, int type)
|
|
|
eb602e4 |
{
|
|
|
eb602e4 |
int on = 0;
|
|
|
eb602e4 |
|
|
|
eb602e4 |
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) {
|
|
|
eb602e4 |
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
|
|
|
eb602e4 |
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) {
|
|
|
eb602e4 |
if (kernel_formats & (1 << QF_XFS))
|
|
|
eb602e4 |
on = kern_quota_on(mnt->mnt_fsname, type, 1 << QF_XFS) != -1;
|
|
|
eb602e4 |
}
|
|
|
eb602e4 |
diff --git a/quotasys.c b/quotasys.c
|
|
|
eb602e4 |
index 9a7f440..2ec23c4 100644
|
|
|
eb602e4 |
--- a/quotasys.c
|
|
|
eb602e4 |
+++ b/quotasys.c
|
|
|
eb602e4 |
@@ -82,7 +82,8 @@ static int correct_fstype(char *type)
|
|
|
eb602e4 |
!strcmp(type, MNTTYPE_NFS) ||
|
|
|
eb602e4 |
!strcmp(type, MNTTYPE_NFS4) ||
|
|
|
eb602e4 |
!strcmp(type, MNTTYPE_OCFS2) ||
|
|
|
eb602e4 |
- !strcmp(type, MNTTYPE_MPFS)) {
|
|
|
eb602e4 |
+ !strcmp(type, MNTTYPE_MPFS) ||
|
|
|
eb602e4 |
+ !strcmp(type, MNTTYPE_GFS2)) {
|
|
|
eb602e4 |
free(mtype);
|
|
|
eb602e4 |
return 1;
|
|
|
eb602e4 |
}
|
|
|
eb602e4 |
@@ -481,7 +482,8 @@ int hasquota(struct mntent *mnt, int type, int flags)
|
|
|
eb602e4 |
if (!correct_fstype(mnt->mnt_type) || hasmntopt(mnt, MNTOPT_NOQUOTA))
|
|
|
eb602e4 |
return 0;
|
|
|
eb602e4 |
|
|
|
eb602e4 |
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS))
|
|
|
eb602e4 |
+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2) ||
|
|
|
eb602e4 |
+ !strcmp(mnt->mnt_type, MNTTYPE_XFS))
|
|
|
eb602e4 |
return hasxfsquota(mnt, type, flags);
|
|
|
eb602e4 |
if (nfs_fstype(mnt->mnt_type)) /* NFS always has quota or better there is no good way how to detect it */
|
|
|
eb602e4 |
return 1;
|