<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/mgmt/glusterd/src/glusterd-utils.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>glusterd: Expect setmntent(3) to return NULL</title>
<updated>2012-09-09T17:41:20+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kparthas@redhat.com</email>
</author>
<published>2012-09-08T06:42:48+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=0b60e7252650355f412974bfc840bc2fc81b4157'/>
<id>0b60e7252650355f412974bfc840bc2fc81b4157</id>
<content type='text'>
- Closed the mtab FILE * using endmntent(3)

Change-Id: I5e1ebb7f092abda638cfbb5524da693dcac6c872
BUG: 851109
Signed-off-by: Krishnan Parthasarathi &lt;kparthas@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3922
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Closed the mtab FILE * using endmntent(3)

Change-Id: I5e1ebb7f092abda638cfbb5524da693dcac6c872
BUG: 851109
Signed-off-by: Krishnan Parthasarathi &lt;kparthas@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3922
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rpc: Reduce frame-timeout for glusterd connections</title>
<updated>2012-08-17T08:13:01+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-08-17T07:42:33+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=30a9ebd91339f36d092f46bbba116fa4047fb8c5'/>
<id>30a9ebd91339f36d092f46bbba116fa4047fb8c5</id>
<content type='text'>
Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is
too long when compared to cli timeout of 2mins. Changing to 10mins reduces the
disparity between cli and glusterd.

Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize
failed.

BUG: 843003
Change-Id: Ie8d5ec16fbbb54318a5935a47065e66fd3338b87
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3812
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>
Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is
too long when compared to cli timeout of 2mins. Changing to 10mins reduces the
disparity between cli and glusterd.

Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize
failed.

BUG: 843003
Change-Id: Ie8d5ec16fbbb54318a5935a47065e66fd3338b87
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3812
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>glusterd: Fix peer probe when username/password is missing</title>
<updated>2012-07-18T06:46:34+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-06-27T05:34:48+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ed9a37fdf4c110697a3c6201764be7ccbb91573e'/>
<id>ed9a37fdf4c110697a3c6201764be7ccbb91573e</id>
<content type='text'>
Prevent failure of building volumes dictionary during peer probe, when
username/password for a volume is missing. This situation can be caused by
migration of gluster from pre-3.3 to 3.3 and above.

BUG: 834229
Change-Id: I042ecfcc5024e6b18c4ffb44ea0977ec58e22ef8
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3629
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>
Prevent failure of building volumes dictionary during peer probe, when
username/password for a volume is missing. This situation can be caused by
migration of gluster from pre-3.3 to 3.3 and above.

BUG: 834229
Change-Id: I042ecfcc5024e6b18c4ffb44ea0977ec58e22ef8
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/3629
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>glusterd: regenerate brick vol-files on upgrade</title>
<updated>2012-05-29T05:52:54+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-05-28T10:01:36+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=c7ed7013e9cc22b1e01d49580d138955034395a3'/>
<id>c7ed7013e9cc22b1e01d49580d138955034395a3</id>
<content type='text'>
If upgrade/downgrade option is set in glusterd it terminates
after the volfiles are regenerated. No need for 'sleep 10'
hack anymore.

Change-Id: I83b1cd83b1cc56c6d221e6f2bbbf58af62cb56b9
BUG: 825872
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3472
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>
If upgrade/downgrade option is set in glusterd it terminates
after the volfiles are regenerated. No need for 'sleep 10'
hack anymore.

Change-Id: I83b1cd83b1cc56c6d221e6f2bbbf58af62cb56b9
BUG: 825872
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3472
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>glusterd: Replace-brick should create dst brick path only on 'dst' node.</title>
<updated>2012-05-28T17:45:12+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-05-23T09:45:51+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=063679d8fbeaad7034db33f1dc4cb1713754cb3a'/>
<id>063679d8fbeaad7034db33f1dc4cb1713754cb3a</id>
<content type='text'>
Change-Id: I61e6f8aa44dfef85c7cd98f40b176b796422c4b2
BUG: 824302
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3457
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>
Change-Id: I61e6f8aa44dfef85c7cd98f40b176b796422c4b2
BUG: 824302
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3457
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>glusterd: Cherry-picked e44ac01b08c3ee from master branch</title>
<updated>2012-05-28T05:37:38+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-05-25T09:32:47+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=d497922a725da0690e5c5c75911e59d30c5d53a1'/>
<id>d497922a725da0690e5c5c75911e59d30c5d53a1</id>
<content type='text'>
        Fix volume create

        Improve Krishnan Parthasarathi's patch, which fixed situation where
        a brick mount point did not had EA enabled. This fixes an incorrect
        assumption that dirname(3) returns the same address it was given as
        argument. GNU dirname(3) does it, BSD dirname(3) does not.

        Also makes the code a bit easier to read.

        Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;

Change-Id: Ie5106b0ee7bda126666cd0ec9c827c895ec035c9
BUG: 812214
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3441
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>
        Fix volume create

        Improve Krishnan Parthasarathi's patch, which fixed situation where
        a brick mount point did not had EA enabled. This fixes an incorrect
        assumption that dirname(3) returns the same address it was given as
        argument. GNU dirname(3) does it, BSD dirname(3) does not.

        Also makes the code a bit easier to read.

        Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;

Change-Id: Ie5106b0ee7bda126666cd0ec9c827c895ec035c9
BUG: 812214
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3441
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>glusterd: Disconnected bricks of 'stale' volume before deleting it.</title>
<updated>2012-05-28T05:33:18+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-04-18T09:00:16+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3d653908554dc92af6b7414df4083bee2b9e039f'/>
<id>3d653908554dc92af6b7414df4083bee2b9e039f</id>
<content type='text'>
If glusterd_delete_bricks is called before glusterd got the DISCONNECT event
from the brick that was stopped, then glusterd_brick_rpc_notify would
dereference a free'd brickinfo. This can happen if the brick had not been
disconnected before.

Change-Id: I6c07ec50f6739422a14478a549edd06c4c0ce913
BUG: 802015
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3442
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>
If glusterd_delete_bricks is called before glusterd got the DISCONNECT event
from the brick that was stopped, then glusterd_brick_rpc_notify would
dereference a free'd brickinfo. This can happen if the brick had not been
disconnected before.

Change-Id: I6c07ec50f6739422a14478a549edd06c4c0ce913
BUG: 802015
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3442
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>glusterd: Fixed glusterd_brick_create_path algo.</title>
<updated>2012-05-19T10:27:20+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-05-07T08:01:24+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ef3cd63cc95c26fdf7f7a2d8046b4686b02cb836'/>
<id>ef3cd63cc95c26fdf7f7a2d8046b4686b02cb836</id>
<content type='text'>
- check if any prefix of the brick path has "trusted.gfid"
  or "trusted.glusterfs.volume-id" set.
- set trusted.glusterfs.volume-id on the bricks as soon as
  its induction into the volume is settled. Earlier, the setting of
  "volume-id" used to happen during the first run of the brick process,
  leaving of window for bricks part of one volume to be (ab)used by another
  volume inadvertently.
- removed creation of brick directory (if missing), during start volume force.
  This is to avoid directory creation as part 'force'ful starting of volume
  and leave the responsibility with the user, who understands the
  'availability' of the export directory (brick) better.

Change-Id: I4237ec4ea7a4e38a7501027e7de7112edd67de8c
BUG: 812214
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3280
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3313
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- check if any prefix of the brick path has "trusted.gfid"
  or "trusted.glusterfs.volume-id" set.
- set trusted.glusterfs.volume-id on the bricks as soon as
  its induction into the volume is settled. Earlier, the setting of
  "volume-id" used to happen during the first run of the brick process,
  leaving of window for bricks part of one volume to be (ab)used by another
  volume inadvertently.
- removed creation of brick directory (if missing), during start volume force.
  This is to avoid directory creation as part 'force'ful starting of volume
  and leave the responsibility with the user, who understands the
  'availability' of the export directory (brick) better.

Change-Id: I4237ec4ea7a4e38a7501027e7de7112edd67de8c
BUG: 812214
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3280
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3313
</pre>
</div>
</content>
</entry>
<entry>
<title>mgmt/glusterd: Avoid re-starting nfs unconditionally.</title>
<updated>2012-05-09T05:14:01+00:00</updated>
<author>
<name>Vijay Bellur</name>
<email>vijay@gluster.com</email>
</author>
<published>2012-04-29T17:38:42+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=53a09f49abb291625c96409627cba348f0c35e55'/>
<id>53a09f49abb291625c96409627cba348f0c35e55</id>
<content type='text'>
NFS server is restarted unconditionally when a volume option is
configured through the set interface. This patch prevents restart
of NFS server when operations are performed on translators that
are not part of the NFS graph.

This does not prevent re-start of a NFS server when an option
corresponding to a translator that is part of the NFS graph is
re-configured.

Change-Id: Ic4b8e48e5e7e80438f230521042c267ec3b96a25
Signed-off-by: Vijay Bellur &lt;vijay@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3247
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NFS server is restarted unconditionally when a volume option is
configured through the set interface. This patch prevents restart
of NFS server when operations are performed on translators that
are not part of the NFS graph.

This does not prevent re-start of a NFS server when an option
corresponding to a translator that is part of the NFS graph is
re-configured.

Change-Id: Ic4b8e48e5e7e80438f230521042c267ec3b96a25
Signed-off-by: Vijay Bellur &lt;vijay@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3247
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
