<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/cli/src/cli-rpc-ops.c, branch v3.3.2qa1</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>localtime and ctime are not MT-SAFE</title>
<updated>2013-02-08T20:04:42+00:00</updated>
<author>
<name>Kaleb S. KEITHLEY</name>
<email>kkeithle@redhat.com</email>
</author>
<published>2012-06-22T15:25:32+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=988460a9f597a489f22d39cd259fdb17fe2e5de6'/>
<id>988460a9f597a489f22d39cd259fdb17fe2e5de6</id>
<content type='text'>
There are a number of nit-level issues throughout the source with
the use of localtime and ctime. While they apparently aren't causing
too many problems, apart from the one in bz 828058, they ought to be
fixed. Among the "real" problems that are fixed in this patch:
1) general localtime and ctime not MT-SAFE. There's a non-zero chance
   that another thread calling localtime (or ctime) will over-write
   the static data about to be used in another thread
2) localtime(&amp; &lt;64-bit-type&gt;) or ctime(&amp; &lt;64-bit-type&gt;) generally
   not a problem on 64-bit or little-endian 32-bit. But even though
   we probably have zero users on big-ending 32-bit platforms, it's
   still incorrect.
3) multiple nested calls passed as params. Last one wins, i.e. over-
   writes result of prior calls.
4) Inconsistent error handling. Most of these calls are for logging,
   tracing, or dumping. I submit that if an error somehow occurs in
   the call to localtime or ctime, the log/trace/dump still should
   still occur.
5) Appliances should all have their clocks set to UTC, and all log
   entries, traces, and dumps should use GMT.
6) fix strtok(), change to strtok_r()

Other things this patch fixes/changes (that aren't bugs per se):
1) Change "%Y-%m-%d %H:%M:%S" and similar to their equivalent shorthand,
   e.g. "%F %T"
2) change sizeof(timestr) to sizeof timestr. sizeof is an operator,
   not a function. You don't use i +(32), why use sizeof(&lt;var&gt;).
   (And yes, you do use parens with sizeof(&lt;type&gt;).)
3) change 'char timestr[256]' to 'char timestr[32]' where appropriate.
   Per-thread stack is limited. Time strings are never longer than ~20
   characters, so why waste 220+ bytes on the stack?

Things this patch doesn't fix:
1) hodgepodge of %Y-%m-%d %H:%M:%S versus %Y/%m/%d-%H%M%S and other
   variations. It's not clear to me whether this ever matters, not to
   mention 3rd party log filtering tools may already rely on a
   particular format. Still it would be nice to have a single manifest
   constant and have every call to localtime/strftime consistently use
   the same format.

BUG: 832173

Change-Id: Iee9719db4576eacc6c75694d9107954d0912cba8
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3613
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
Tested-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are a number of nit-level issues throughout the source with
the use of localtime and ctime. While they apparently aren't causing
too many problems, apart from the one in bz 828058, they ought to be
fixed. Among the "real" problems that are fixed in this patch:
1) general localtime and ctime not MT-SAFE. There's a non-zero chance
   that another thread calling localtime (or ctime) will over-write
   the static data about to be used in another thread
2) localtime(&amp; &lt;64-bit-type&gt;) or ctime(&amp; &lt;64-bit-type&gt;) generally
   not a problem on 64-bit or little-endian 32-bit. But even though
   we probably have zero users on big-ending 32-bit platforms, it's
   still incorrect.
3) multiple nested calls passed as params. Last one wins, i.e. over-
   writes result of prior calls.
4) Inconsistent error handling. Most of these calls are for logging,
   tracing, or dumping. I submit that if an error somehow occurs in
   the call to localtime or ctime, the log/trace/dump still should
   still occur.
5) Appliances should all have their clocks set to UTC, and all log
   entries, traces, and dumps should use GMT.
6) fix strtok(), change to strtok_r()

Other things this patch fixes/changes (that aren't bugs per se):
1) Change "%Y-%m-%d %H:%M:%S" and similar to their equivalent shorthand,
   e.g. "%F %T"
2) change sizeof(timestr) to sizeof timestr. sizeof is an operator,
   not a function. You don't use i +(32), why use sizeof(&lt;var&gt;).
   (And yes, you do use parens with sizeof(&lt;type&gt;).)
3) change 'char timestr[256]' to 'char timestr[32]' where appropriate.
   Per-thread stack is limited. Time strings are never longer than ~20
   characters, so why waste 220+ bytes on the stack?

Things this patch doesn't fix:
1) hodgepodge of %Y-%m-%d %H:%M:%S versus %Y/%m/%d-%H%M%S and other
   variations. It's not clear to me whether this ever matters, not to
   mention 3rd party log filtering tools may already rely on a
   particular format. Still it would be nice to have a single manifest
   constant and have every call to localtime/strftime consistently use
   the same format.

BUG: 832173

Change-Id: Iee9719db4576eacc6c75694d9107954d0912cba8
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3613
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
Tested-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Proper xml output for "gluster peer status"</title>
<updated>2012-08-30T10:37:40+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-08-29T13:02:29+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ace4cae71c19004c51fe5116c67492acaf2afc73'/>
<id>ace4cae71c19004c51fe5116c67492acaf2afc73</id>
<content type='text'>
Change-Id: I90952ba2ea606552cf4ad67dd296a440f90592d6
BUG: 847760
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3870
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I90952ba2ea606552cf4ad67dd296a440f90592d6
BUG: 847760
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3870
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli/: Displaying the size in human readable format</title>
<updated>2012-08-21T03:41:29+00:00</updated>
<author>
<name>Varun Shastry</name>
<email>vshastry@redhat.com</email>
</author>
<published>2012-08-13T10:20:45+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=d0c52c8064a4097d97180240b36c53bfe98cac22'/>
<id>d0c52c8064a4097d97180240b36c53bfe98cac22</id>
<content type='text'>
rebalance status displaying the size in bytes. Converted to
human readable

Change-Id: Id73b6e792c39b85480ddf1dc9c0c22fcaca29530
BUG: 825193
Signed-off-by: Varun Shastry &lt;vshastry@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3810
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rebalance status displaying the size in bytes. Converted to
human readable

Change-Id: Id73b6e792c39b85480ddf1dc9c0c22fcaca29530
BUG: 825193
Signed-off-by: Varun Shastry &lt;vshastry@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3810
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>calls to dict_allocate_and_serialize() are not 64-bit clean</title>
<updated>2012-08-03T10:54:50+00:00</updated>
<author>
<name>Kaleb S. KEITHLEY</name>
<email>kkeithle@redhat.com</email>
</author>
<published>2012-07-10T14:19:16+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=0c1cee625818275dd1b3f6718bd246d2e30dabd1'/>
<id>0c1cee625818275dd1b3f6718bd246d2e30dabd1</id>
<content type='text'>
All calls to dict_allocate_and_serialize() pass the address of a 32-bit
type, but must cast it to the 64-bit pointer type (size_t *).

This happens to work on LE machines, but even if it's apparently benign,
it's still a bug. On BE machines it is not benign.

GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp
var, but that's, well, a hack, IMO when you consider that all the callers
are actually passing &amp;&lt;u_int&gt;; the param should just be a u_int * and
eliminate the buggy casts and the temp var in the macro.

Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People
are trying to build gluster.org bits on SPARC and tripping over this.

Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
BUG: 838928
Reviewed-on: http://review.gluster.com/3643
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All calls to dict_allocate_and_serialize() pass the address of a 32-bit
type, but must cast it to the 64-bit pointer type (size_t *).

This happens to work on LE machines, but even if it's apparently benign,
it's still a bug. On BE machines it is not benign.

GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp
var, but that's, well, a hack, IMO when you consider that all the callers
are actually passing &amp;&lt;u_int&gt;; the param should just be a u_int * and
eliminate the buggy casts and the temp var in the macro.

Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People
are trying to build gluster.org bits on SPARC and tripping over this.

Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
BUG: 838928
Reviewed-on: http://review.gluster.com/3643
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Change cli output for heal commands</title>
<updated>2012-08-02T06:28:32+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-06-11T06:08:14+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=d451dfeb4643b1894e99dc66454f630d26c459a1'/>
<id>d451dfeb4643b1894e99dc66454f630d26c459a1</id>
<content type='text'>
BUG: 826406
Change-Id: Ic32c89b92314ee201ec67afc4617e412d4b4c21d
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3636
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: 826406
Change-Id: Ic32c89b92314ee201ec67afc4617e412d4b4c21d
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3636
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Fix time_t conversions</title>
<updated>2012-06-13T15:28:01+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-06-07T08:31:46+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=a04bbeafa9b96c0f05e6403749d2b8002b6c4f12'/>
<id>a04bbeafa9b96c0f05e6403749d2b8002b6c4f12</id>
<content type='text'>
Change-Id: I98eb76e5971ea800a249d21557d5dd4f093fdaaf
BUG: 828058
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3534
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Tested-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I98eb76e5971ea800a249d21557d5dd4f093fdaaf
BUG: 828058
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3534
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Tested-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-by: Joe Julian &lt;me@joejulian.name&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Self-heald: Print the time stamp of the event-history</title>
<updated>2012-05-18T06:30:31+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-04-20T11:52:43+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=27f4cc44140260516efa5a226b9f49b761b6b559'/>
<id>27f4cc44140260516efa5a226b9f49b761b6b559</id>
<content type='text'>
BUG: 796579
Change-Id: I4c738d9073b53fc3c4d4797b5f01e841dae1b4e9
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3352
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: 796579
Change-Id: I4c738d9073b53fc3c4d4797b5f01e841dae1b4e9
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3352
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: fix remove-brick output behavior in failure cases</title>
<updated>2012-05-04T04:28:37+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-05-02T08:53:27+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3b47032cbec05ebd90a73e362eaf2653789a09bc'/>
<id>3b47032cbec05ebd90a73e362eaf2653789a09bc</id>
<content type='text'>
earlier it was dependant on server sending the dict for knowing
the command. Now it preserves the dictionary in frame-&gt;local,
which is used to understand the command.

Change-Id: Ica675b497e466f77878f67792ae96b71f0704d6b
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815745
Reviewed-on: http://review.gluster.com/3235
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Shishir Gowda &lt;shishirng@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
earlier it was dependant on server sending the dict for knowing
the command. Now it preserves the dictionary in frame-&gt;local,
which is used to understand the command.

Change-Id: Ica675b497e466f77878f67792ae96b71f0704d6b
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815745
Reviewed-on: http://review.gluster.com/3235
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Shishir Gowda &lt;shishirng@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Make use of cli_err()</title>
<updated>2012-04-27T05:50:38+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-04-26T08:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ecb818902e4ee7491aaeae21226b62a0ab806370'/>
<id>ecb818902e4ee7491aaeae21226b62a0ab806370</id>
<content type='text'>
Use cli_err() in case of errors instead of cli_out().

Change-Id: Ib0766e59516a1ccd56a2133f33fac3877c4384d6
BUG: 815194
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3229
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use cli_err() in case of errors instead of cli_out().

Change-Id: Ib0766e59516a1ccd56a2133f33fac3877c4384d6
BUG: 815194
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3229
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: implement a fn 'cli_err()' to send error messages to 'stderr'</title>
<updated>2012-04-25T07:45:51+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-04-23T05:41:43+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3f35280a364bd35293d3e5804eb2a659a7f174b1'/>
<id>3f35280a364bd35293d3e5804eb2a659a7f174b1</id>
<content type='text'>
we were using 'cli_out()' to send all the possible msgs, which is not
very friendly with scripts, because if one want to get only valid
output with "&lt;command&gt; 2&gt;/error.log 1&gt;/proper-info.log"

Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815194
Reviewed-on: http://review.gluster.com/3208
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
we were using 'cli_out()' to send all the possible msgs, which is not
very friendly with scripts, because if one want to get only valid
output with "&lt;command&gt; 2&gt;/error.log 1&gt;/proper-info.log"

Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815194
Reviewed-on: http://review.gluster.com/3208
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
