<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/features/locks/src/posix.c, branch v3.3.2</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.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://git.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://git.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>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://git.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>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://git.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://git.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://git.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: 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://git.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>
<entry>
<title>core: adding extra data for fops</title>
<updated>2012-03-22T23:40:27+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-03-20T11:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=9d3af972f516b6ba38d2736ce2016e34a452d569'/>
<id>9d3af972f516b6ba38d2736ce2016e34a452d569</id>
<content type='text'>
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.

Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
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>
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.

Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
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>features/locks: Make inodelk ref-counted</title>
<updated>2012-03-10T10:24:30+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-03-07T12:18:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=f75277b12af4c7e72c448480feec0d0e2e6582cd'/>
<id>f75277b12af4c7e72c448480feec0d0e2e6582cd</id>
<content type='text'>
Ref when the object is allocated.
Unref after the response is submitted to that inodelk.

Ref when the lock is granted.
Unref when the lock is unlocked.

Change-Id: I2bfe9182b67bea7dc7b9d0ed9f99f1c7fa0b8a3c
BUG: 783449
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/2891
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>
Ref when the object is allocated.
Unref after the response is submitted to that inodelk.

Ref when the lock is granted.
Unref when the lock is unlocked.

Change-Id: I2bfe9182b67bea7dc7b9d0ed9f99f1c7fa0b8a3c
BUG: 783449
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/2891
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: Made dump locks formatting more 'readable'.</title>
<updated>2012-02-24T13:13:50+00:00</updated>
<author>
<name>Krishnan Parthasarathi</name>
<email>kp@gluster.com</email>
</author>
<published>2011-12-15T12:08:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=728de5be7ce2975efb59bb5928fd7261d5ec7760'/>
<id>728de5be7ce2975efb59bb5928fd7261d5ec7760</id>
<content type='text'>
Also,
Added inode's path to dump locks.
Added basename to entrylk dump output.
Added whence field of range locks to dump output.

Change-Id: Ifd3f8b585a52de7ff68cd54506619ac3eaedeecc
BUG: 789858
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/798
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>
Also,
Added inode's path to dump locks.
Added basename to entrylk dump output.
Added whence field of range locks to dump output.

Change-Id: Ifd3f8b585a52de7ff68cd54506619ac3eaedeecc
BUG: 789858
Signed-off-by: Krishnan Parthasarathi &lt;kp@gluster.com&gt;
Reviewed-on: http://review.gluster.com/798
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
