Message ID | b49366ac-d277-a26f-1936-8e736d1c913c@sandeen.net (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On 9/14/16 12:50 PM, Eric Sandeen wrote: >> @@ -113,8 +119,13 @@ path_f( > Oops, I mentioned this to you as needed, but it's wrong, sorry. > > Just drop this hunk, this is supposed to select path i, not iterate > over anything. Sorry for mentioning it. > >> > printf(_("value %d is out of range (0-%d)\n"), >> > i, fs_count-1); >> > } else { >> > - fs_path = &fs_table[i]; >> > - pathlist_f(); >> > + for (i = 0; i < fs_count; i++) { >> > + fs_path = &fs_table[i]; >> > + /* Table is ordered xfs first, then foreign */ >> > + if (fs_path->fs_flags & FS_FOREIGN && !foreign_allowed) >> > + break; >> > + pathlist_f(); >> > + } >> > } >> > return 0; >> > } Oh, right. You need the test & break in print_f not path_f, otherwise: # quota/xfs_quota -x xfs_quota> print Filesystem Pathname /home /dev/mapper/vg_bp05-lv_home /mnt/test2 /dev/sdc1 (F) / /dev/mapper/vg_bp05-lv_root (F) /boot /dev/sda1 (F) /mnt/test /dev/sdb1 xfs_quota> "print" gives you foreign filesystems when you didn't ask for them. -Eric
diff --git a/quota/path.c b/quota/path.c index bb28d82..546db52 100644 --- a/quota/path.c +++ b/quota/path.c @@ -105,6 +105,7 @@ path_f( char **argv) { int i; + int max = foreign_allowed ? fs_count : xfs_fs_count; if (fs_count == 0) { printf(_("No paths are available\n")); @@ -115,9 +116,9 @@ path_f( return pathlist_f(); i = atoi(argv[1]); - if (i < 0 || i >= fs_count) { + if (i < 0 || i >= max) { printf(_("value %d is out of range (0-%d)\n"), - i, fs_count-1); + i, max - 1); } else { fs_path = &fs_table[i]; pathlist_f();