Blame quota-4.00_pre1-Fix-synopsis-and-properly-report-errors-during-remot.patch

9c0335
From 8d4c4a761c27a81d96ae8c49e1b8d32d66b6751e Mon Sep 17 00:00:00 2001
9c0335
From: Jan Kara <jack@suse.cz>
9c0335
Date: Tue, 8 Mar 2011 23:36:47 +0100
9c0335
Subject: [PATCH 1/2] Fix synopsis and properly report errors during remote grace period setting
9c0335
9c0335
Signed-off-by: Jan Kara <jack@suse.cz>
9c0335
---
9c0335
 edquota.8  |    2 ++
9c0335
 setquota.8 |    4 +---
9c0335
 setquota.c |   11 ++++++++---
9c0335
 3 files changed, 11 insertions(+), 6 deletions(-)
9c0335
9c0335
diff --git a/edquota.8 b/edquota.8
9c0335
index 4b1406b..2ef4cb6 100644
9c0335
--- a/edquota.8
9c0335
+++ b/edquota.8
9c0335
@@ -38,6 +38,8 @@ edquota \- edit user quotas
9c0335
 .BR \-u \ |
9c0335
 .B \-g
9c0335
 ] [
9c0335
+.B \-rm
9c0335
+] [
9c0335
 .B \-F
9c0335
 .I format-name
9c0335
 ] [
9c0335
diff --git a/setquota.8 b/setquota.8
9c0335
index e3ac7e0..6c3dc88 100644
9c0335
--- a/setquota.8
9c0335
+++ b/setquota.8
9c0335
@@ -67,8 +67,6 @@ setquota \- set disk quotas
9c0335
 .B setquota
9c0335
 .B \-t
9c0335
 [
9c0335
-.B \-m
9c0335
-] [
9c0335
 .B \-u
9c0335
 |
9c0335
 .B \-g
9c0335
@@ -86,7 +84,7 @@ setquota \- set disk quotas
9c0335
 .B setquota
9c0335
 .B \-T
9c0335
 [
9c0335
-.B \-m
9c0335
+.B \-rm
9c0335
 ] [
9c0335
 .B \-u
9c0335
 |
9c0335
diff --git a/setquota.c b/setquota.c
9c0335
index 5d2734b..d1cffcb 100644
9c0335
--- a/setquota.c
9c0335
+++ b/setquota.c
9c0335
@@ -58,7 +58,7 @@ static void usage(void)
9c0335
   setquota [-u|-g] %1$s[-F quotaformat] <-p protouser|protogroup> <user|group> -a|<filesystem>...\n\
9c0335
   setquota [-u|-g] %1$s[-F quotaformat] -b [-c] -a|<filesystem>...\n\
9c0335
   setquota [-u|-g] [-F quotaformat] -t <blockgrace> <inodegrace> -a|<filesystem>...\n\
9c0335
-  setquota [-u|-g] [-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...\n\n\
9c0335
+  setquota [-u|-g] %1$s[-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...\n\n\
9c0335
 -u, --user                 set limits for user\n\
9c0335
 -g, --group                set limits for group\n\
9c0335
 -a, --all                  set limits for all filesystems\n\
9c0335
@@ -372,14 +372,19 @@ static int batch_setlimits(struct quota_handle **handles)
9c0335
 /* Set grace times */
9c0335
 static int setgraces(struct quota_handle **handles)
9c0335
 {
9c0335
-	int i;
9c0335
+	int i, ret = 0;
9c0335
 
9c0335
 	for (i = 0; handles[i]; i++) {
9c0335
+		if (handles[i]->qh_ops->write_info) {
9c0335
+			errstr(_("Setting grace period on %s is not supported.\n"), handles[i]->qh_quotadev);
9c0335
+			ret = -1;
9c0335
+			continue;
9c0335
+		}
9c0335
 		handles[i]->qh_info.dqi_bgrace = toset.dqb_btime;
9c0335
 		handles[i]->qh_info.dqi_igrace = toset.dqb_itime;
9c0335
 		mark_quotafile_info_dirty(handles[i]);
9c0335
 	}
9c0335
-	return 0;
9c0335
+	return ret;
9c0335
 }
9c0335
 
9c0335
 /* Set grace times for individual user */
9c0335
-- 
9c0335
1.7.4
9c0335