Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2011 13:40:37 +0300
From:      Sergey Kandaurov <pluknet@freebsd.org>
To:        freebsd-fs@freebsd.org
Subject:   Minor change in ufs_quota.c uprintf() fmt
Message-ID:  <AANLkTin%2BgyZgcvG8rjw4oDaqe%2BEj0zp_EhyMXca4%2B4HV@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hello.

I found a minor issue in sys/ufs/ufs_quota.c: here uprintf()
suboptimally formats a quota error message with "%s",
while it is a hardcoded null-terminated character string.

The purpose of my change is to embed the quota message
into uprintf() fmt itself, thus it will look a bit more correct.
While here, I fixed whitespaces around there (tab -> 4 spaces).

I'm going to check it in if nobody objects.  Please, see attached.

-- 
wbr,
pluknet

[-- Attachment #2 --]
Index: sys/ufs/ufs/ufs_quota.c
===================================================================
--- sys/ufs/ufs/ufs_quota.c	(revision 217308)
+++ sys/ufs/ufs/ufs_quota.c	(working copy)
@@ -238,9 +238,9 @@
 		dq->dq_flags |= DQ_MOD;
 		DQI_UNLOCK(dq);
 		if (warn)
-			uprintf("\n%s: warning, %s %s\n",
-				ITOV(ip)->v_mount->mnt_stat.f_mntonname,
-				quotatypes[i], "disk quota exceeded");
+			uprintf("\n%s: warning, %s disk quota exceeded\n",
+			    ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+			    quotatypes[i]);
 	}
 	return (0);
 }
@@ -289,10 +289,10 @@
 			    ip->i_uid == cred->cr_uid) {
 				dq->dq_flags |= DQ_BLKS;
 				DQI_UNLOCK(dq);
-				uprintf("\n%s: write failed, %s %s\n",
+				uprintf("\n%s: write failed, %s "
+				    "disk quota exceeded for too long\n",
 				    ITOV(ip)->v_mount->mnt_stat.f_mntonname,
-				    quotatypes[type],
-				    "disk quota exceeded for too long");
+				    quotatypes[type]);
 				return (EDQUOT);
 			}
 			DQI_UNLOCK(dq);
@@ -384,9 +384,9 @@
 		dq->dq_flags |= DQ_MOD;
 		DQI_UNLOCK(dq);
 		if (warn)
-			uprintf("\n%s: warning, %s %s\n",
-				ITOV(ip)->v_mount->mnt_stat.f_mntonname,
-				quotatypes[i], "inode quota exceeded");
+			uprintf("\n%s: warning, %s inode quota exceeded\n",
+			    ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+			    quotatypes[i]);
 	}
 	return (0);
 }
@@ -434,10 +434,10 @@
 			    ip->i_uid == cred->cr_uid) {
 				dq->dq_flags |= DQ_INODS;
 				DQI_UNLOCK(dq);
-				uprintf("\n%s: write failed, %s %s\n",
-					ITOV(ip)->v_mount->mnt_stat.f_mntonname,
-					quotatypes[type],
-					"inode quota exceeded for too long");
+				uprintf("\n%s: write failed, %s "
+				    "inode quota exceeded for too long\n",
+				    ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+				    quotatypes[type]);
 				return (EDQUOT);
 			}
 			DQI_UNLOCK(dq);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTin%2BgyZgcvG8rjw4oDaqe%2BEj0zp_EhyMXca4%2B4HV>