<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/features/locks/src, 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>features/locks: Fix statedump code</title>
<updated>2012-08-12T07:12:09+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-07-28T06:48:50+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=aa4e7d04ff20e38182a62576595951d59524fff0'/>
<id>aa4e7d04ff20e38182a62576595951d59524fff0</id>
<content type='text'>
RCA:
Taking blocking mutex/spin locks lead to dead locks
because of the locking order in statedumps. Also we
were asked to remove gf_logs if possible to avoid extra
cost in signal handlers.

Fix:
changed blocking mutes/spin locks to their non-blocking variants.
Removed gf_logs in locks xlator statedump code-path.

Tests:
State-dump success cases are working fine.
Triggered try-lock failures by putting statedumps in a while loop.
In parallel did chown of the same file in a while loop.

BUG: 843781
Change-Id: Iac9b75d79cd5e036cd3eafc1e106074e2c6b5c47
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3752
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>
RCA:
Taking blocking mutex/spin locks lead to dead locks
because of the locking order in statedumps. Also we
were asked to remove gf_logs if possible to avoid extra
cost in signal handlers.

Fix:
changed blocking mutes/spin locks to their non-blocking variants.
Removed gf_logs in locks xlator statedump code-path.

Tests:
State-dump success cases are working fine.
Triggered try-lock failures by putting statedumps in a while loop.
In parallel did chown of the same file in a while loop.

BUG: 843781
Change-Id: Iac9b75d79cd5e036cd3eafc1e106074e2c6b5c47
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3752
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>locks: Fixed opt arg parsing in clear-locks</title>
<updated>2012-05-24T18:08:08+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-05-19T18:10:13+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ed67fbf9d22a8099155795a5482c219f488992c3'/>
<id>ed67fbf9d22a8099155795a5482c219f488992c3</id>
<content type='text'>
Change-Id: I470fd21d5d53e3c6f0bd2a4f84c6327532e18559
BUG: 823151
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3429
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: I470fd21d5d53e3c6f0bd2a4f84c6327532e18559
BUG: 823151
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3429
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>features/locks: Don't delete blocked locks in pl_flush</title>
<updated>2012-05-22T11:30:19+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-05-18T11:30:07+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=27960b127ea55f1bd877c1e421c93fea3a2c42af'/>
<id>27960b127ea55f1bd877c1e421c93fea3a2c42af</id>
<content type='text'>
BUG: 810502
Change-Id: I68c1c11754e1f4413b457c5f4bb7da3bc1aafc23
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3398
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: 810502
Change-Id: I68c1c11754e1f4413b457c5f4bb7da3bc1aafc23
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3398
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>features/locks: insert_and_merge should not operate on blocked locks</title>
<updated>2012-05-22T11:30:01+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-05-18T05:36:52+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f742f5e6902af5c984f948c8ef5c38022752a018'/>
<id>f742f5e6902af5c984f948c8ef5c38022752a018</id>
<content type='text'>
BUG: 810502
Change-Id: I1c560dae638ddb66f47ea64b661979b31708731b
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3397
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: 810502
Change-Id: I1c560dae638ddb66f47ea64b661979b31708731b
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3397
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>locks: Set flock.l_type on successful F_UNLCK to signal last unlock on fd.</title>
<updated>2012-05-10T22:26:54+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2012-05-10T10:18:22+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=72da7808cb0497b4ac6df55c58c9bf34daeee7ac'/>
<id>72da7808cb0497b4ac6df55c58c9bf34daeee7ac</id>
<content type='text'>
NLM expects a successful F_UNLCK on an fd to set flock.l_type to F_UNLCK
if it were the last unlock else F_RDLCK.

Change-Id: Ib304ac6102664abbb13d1fda649b3da63f1ee97e
BUG: 800300
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3306
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Krishna Srinivas &lt;krishna@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>
NLM expects a successful F_UNLCK on an fd to set flock.l_type to F_UNLCK
if it were the last unlock else F_RDLCK.

Change-Id: Ib304ac6102664abbb13d1fda649b3da63f1ee97e
BUG: 800300
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3306
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Krishna Srinivas &lt;krishna@gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>features/locks: Find parent-entrylk presence in lookup</title>
<updated>2012-04-19T05:20:47+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-04-17T07:50:43+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=fb9f485db2b4a92c16c0683cf3d5cfcd07054d71'/>
<id>fb9f485db2b4a92c16c0683cf3d5cfcd07054d71</id>
<content type='text'>
Change-Id: I8fc85676827f26b07bf578ea1152d3e251adb4af
BUG: 765551
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3177
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>
Change-Id: I8fc85676827f26b07bf578ea1152d3e251adb4af
BUG: 765551
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3177
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>locks, stripe: check if dict is NULL before refing it</title>
<updated>2012-04-03T11:20:48+00:00</updated>
<author>
<name>Raghavendra Bhat</name>
<email>raghavendrabhat@gluster.com</email>
</author>
<published>2012-04-03T09:52:45+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3c5aed7d8226e50296c6a7106e0d59682732e9b5'/>
<id>3c5aed7d8226e50296c6a7106e0d59682732e9b5</id>
<content type='text'>
Change-Id: Ifab58504280ed92e4435f7805052745e56bef5ef
BUG: 808003
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3073
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: Ifab58504280ed92e4435f7805052745e56bef5ef
BUG: 808003
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3073
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>features/locks: INIT the list before insert_merge</title>
<updated>2012-03-31T12:17:09+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-03-30T06:33:32+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=96e68adc348e96c1b9d70f6a621f607591f052c2'/>
<id>96e68adc348e96c1b9d70f6a621f607591f052c2</id>
<content type='text'>
Change-Id: I1612565e2bbf1811a85341016b86571bdf6e5062
BUG: 805994
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3047
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@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>
Change-Id: I1612565e2bbf1811a85341016b86571bdf6e5062
BUG: 805994
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3047
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>features/locks: check whether dict is NULL before refing it</title>
<updated>2012-03-29T14:47:11+00:00</updated>
<author>
<name>Raghavendra Bhat</name>
<email>raghavendrabhat@gluster.com</email>
</author>
<published>2012-03-29T11:01:24+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=735714edca08e2de16c0e447f8c3256913186ce6'/>
<id>735714edca08e2de16c0e447f8c3256913186ce6</id>
<content type='text'>
Change-Id: I8906b80e584466aceb5a7402e3cee6ac2a552fab
BUG: 808003
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3036
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I8906b80e584466aceb5a7402e3cee6ac2a552fab
BUG: 808003
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3036
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
