From: Nathan Scott Date: Tue, 7 Jun 2005 23:34:55 +0000 (+0000) Subject: Fix minor xfs_quota double-reporting issue found by QA testing project quota; bump... X-Git-Tag: v2.7.0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa13a00f174b82aa780d027874015b24b8e88ecc;p=thirdparty%2Fxfsprogs-dev.git Fix minor xfs_quota double-reporting issue found by QA testing project quota; bump xfsprogs version. --- diff --git a/VERSION b/VERSION index b59990c97..c48b852c6 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=31 +PKG_REVISION=32 PKG_BUILD=1 diff --git a/debian/changelog b/debian/changelog index c2f1fd4bb..cace49c74 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xfsprogs (2.6.31-1) unstable; urgency=low +xfsprogs (2.6.32-1) unstable; urgency=low * New upstream release. - -- Nathan Scott Mon, 06 Jun 2005 11:52:23 +1000 + -- Nathan Scott Wed, 08 Jun 2005 09:01:04 +1000 xfsprogs (2.6.28-1) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index ceca6fafd..90b863b77 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,8 @@ +xfsprogs-2.6.32 (08 June 2005) + - Minor endian cleanups in some tools. + - Fix a couple of xfs_quota double-reporting issues when + issuing commands via the -c (command line) 0option. + xfsprogs-2.6.31 (06 June 2005) - Fix previous MD driver-specific change to correctly handle (i.e. not "stripe align") linear arrays. diff --git a/quota/init.c b/quota/init.c index 3c52c4001..a779ac1d5 100644 --- a/quota/init.c +++ b/quota/init.c @@ -99,6 +99,8 @@ init_args_command( fs_path = &fs_table[index++]; } while ((fs_path->fs_flags & FS_PROJECT_PATH) && index < fs_count); + if (fs_path->fs_flags & FS_PROJECT_PATH) + return 0; if (index > fs_count) return 0; return index; @@ -147,10 +149,11 @@ init( } } - if (optind == argc) + if (optind == argc) { fs_table_initialise(); - else while (optind < argc) { - fs_table_insert_mount(argv[optind++]); + } else { + while (optind < argc) + fs_table_insert_mount(argv[optind++]); if (!nprojopts) fs_table_insert_project(NULL); else diff --git a/quota/quot.c b/quota/quot.c index 751cb286b..41b18eb6a 100644 --- a/quota/quot.c +++ b/quota/quot.c @@ -408,11 +408,14 @@ quot_f( if ((fp = fopen_write_secure(fname)) == NULL) return 0; - if (argc == optind) - quot_any_type(fp, form, type, (flags & ALL_MOUNTS_FLAG) ? - NULL : fs_path->fs_dir, flags); - else while (argc > optind) + if (argc == optind) { + if (flags & ALL_MOUNTS_FLAG) + quot_any_type(fp, form, type, NULL, flags); + else if (fs_path->fs_flags & FS_MOUNT_POINT) + quot_any_type(fp, form, type, fs_path->fs_dir, flags); + } else while (argc > optind) { quot_any_type(fp, form, type, argv[optind++], flags); + } if (fname) fclose(fp); diff --git a/quota/report.c b/quota/report.c index a32e016d7..b0c915497 100644 --- a/quota/report.c +++ b/quota/report.c @@ -545,7 +545,7 @@ report_f( char **argv) { FILE *fp = NULL; - char *dir, *fname = NULL; + char *fname = NULL; uint lower = 0, upper = 0; int c, flags = 0, type = 0, form = 0; @@ -607,12 +607,16 @@ report_f( if ((fp = fopen_write_secure(fname)) == NULL) return 0; - if (argc == optind) - report_any_type(fp, form, type, (flags & ALL_MOUNTS_FLAG) ? - NULL : fs_path->fs_dir, lower, upper, flags); - else while (argc > optind) { - dir = argv[optind++]; - report_any_type(fp, form, type, dir, lower, upper, flags); + if (argc == optind) { + if (flags & ALL_MOUNTS_FLAG) + report_any_type(fp, form, type, NULL, + lower, upper, flags); + else if (fs_path->fs_flags & FS_MOUNT_POINT) + report_any_type(fp, form, type, fs_path->fs_dir, + lower, upper, flags); + } else while (argc > optind) { + report_any_type(fp, form, type, argv[optind++], + lower, upper, flags); } if (fname) diff --git a/quota/state.c b/quota/state.c index 4fb1467d0..57d4f78ec 100644 --- a/quota/state.c +++ b/quota/state.c @@ -246,8 +246,10 @@ state_f( if (!type) type = XFS_USER_QUOTA | XFS_GROUP_QUOTA | XFS_PROJ_QUOTA; - state_quotafile(fp, type, (flags & ALL_MOUNTS_FLAG) ? - NULL : fs_path->fs_dir, flags); + if (flags & ALL_MOUNTS_FLAG) + state_quotafile(fp, type, NULL, flags); + else if (fs_path->fs_flags & FS_MOUNT_POINT) + state_quotafile(fp, type, fs_path->fs_dir, flags); if (fname) fclose(fp); @@ -391,7 +393,8 @@ enable_f( qflags |= XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD; } - enable_enforcement(fs_path->fs_dir, type, qflags, flags); + if (fs_path->fs_flags & FS_MOUNT_POINT) + enable_enforcement(fs_path->fs_dir, type, qflags, flags); return 0; } @@ -432,7 +435,8 @@ disable_f( qflags |= XFS_QUOTA_UDQ_ACCT; } - disable_enforcement(fs_path->fs_dir, type, qflags, flags); + if (fs_path->fs_flags & FS_MOUNT_POINT) + disable_enforcement(fs_path->fs_dir, type, qflags, flags); return 0; } @@ -473,7 +477,8 @@ off_f( qflags |= XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD; } - quotaoff(fs_path->fs_dir, type, qflags, flags); + if (fs_path->fs_flags & FS_MOUNT_POINT) + quotaoff(fs_path->fs_dir, type, qflags, flags); return 0; } @@ -514,7 +519,8 @@ remove_f( qflags |= XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD; } - remove_extents(fs_path->fs_dir, type, qflags, flags); + if (fs_path->fs_flags & FS_MOUNT_POINT) + remove_extents(fs_path->fs_dir, type, qflags, flags); return 0; }