<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/locks.c, branch v2.6.26-rc7</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>Add new 'cond_resched_bkl()' helper function</title>
<updated>2008-05-11T23:04:48+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-05-11T23:04:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c3921ab71507b108d51a0f1ee960f80cd668a93d'/>
<id>c3921ab71507b108d51a0f1ee960f80cd668a93d</id>
<content type='text'>
It acts exactly like a regular 'cond_resched()', but will not get
optimized away when CONFIG_PREEMPT is set.

Normal kernel code is already preemptable in the presense of
CONFIG_PREEMPT, so cond_resched() is optimized away (see commit
02b67cc3ba36bdba351d6c3a00593f4ec550d9d3 "sched: do not do
cond_resched() when CONFIG_PREEMPT").

But when wanting to conditionally reschedule while holding a lock, you
need to use "cond_sched_lock(lock)", and the new function is the BKL
equivalent of that.

Also make fs/locks.c use it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It acts exactly like a regular 'cond_resched()', but will not get
optimized away when CONFIG_PREEMPT is set.

Normal kernel code is already preemptable in the presense of
CONFIG_PREEMPT, so cond_resched() is optimized away (see commit
02b67cc3ba36bdba351d6c3a00593f4ec550d9d3 "sched: do not do
cond_resched() when CONFIG_PREEMPT").

But when wanting to conditionally reschedule while holding a lock, you
need to use "cond_sched_lock(lock)", and the new function is the BKL
equivalent of that.

Also make fs/locks.c use it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] fix SMP ordering hole in fcntl_setlk()</title>
<updated>2008-05-06T17:58:34+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2008-05-06T17:58:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=0b2bac2f1ea0d33a3621b27ca68b9ae760fca2e9'/>
<id>0b2bac2f1ea0d33a3621b27ca68b9ae760fca2e9</id>
<content type='text'>
fcntl_setlk()/close() race prevention has a subtle hole - we need to
make sure that if we *do* have an fcntl/close race on SMP box, the
access to descriptor table and inode-&gt;i_flock won't get reordered.

As it is, we get STORE inode-&gt;i_flock, LOAD descriptor table entry vs.
STORE descriptor table entry, LOAD inode-&gt;i_flock with not a single
lock in common on both sides.  We do have BKL around the first STORE,
but check in locks_remove_posix() is outside of BKL and for a good
reason - we don't want BKL on common path of close(2).

Solution is to hold -&gt;file_lock around fcheck() in there; that orders
us wrt removal from descriptor table that preceded locks_remove_posix()
on close path and we either come first (in which case eviction will be
handled by the close side) or we'll see the effect of close and do
eviction ourselves.  Note that even though it's read-only access,
we do need -&gt;file_lock here - rcu_read_lock() won't be enough to
order the things.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fcntl_setlk()/close() race prevention has a subtle hole - we need to
make sure that if we *do* have an fcntl/close race on SMP box, the
access to descriptor table and inode-&gt;i_flock won't get reordered.

As it is, we get STORE inode-&gt;i_flock, LOAD descriptor table entry vs.
STORE descriptor table entry, LOAD inode-&gt;i_flock with not a single
lock in common on both sides.  We do have BKL around the first STORE,
but check in locks_remove_posix() is outside of BKL and for a good
reason - we don't want BKL on common path of close(2).

Solution is to hold -&gt;file_lock around fcheck() in there; that orders
us wrt removal from descriptor table that preceded locks_remove_posix()
on close path and we either come first (in which case eviction will be
handled by the close side) or we'll see the effect of close and do
eviction ourselves.  Note that even though it's read-only access,
we do need -&gt;file_lock here - rcu_read_lock() won't be enough to
order the things.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] split linux/file.h</title>
<updated>2008-05-01T17:08:16+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2008-04-24T11:44:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9f3acc3140444a900ab280de942291959f0f615d'/>
<id>9f3acc3140444a900ab280de942291959f0f615d</id>
<content type='text'>
Initial splitoff of the low-level stuff; taken to fdtable.h

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Initial splitoff of the low-level stuff; taken to fdtable.h

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Export __locks_copy_lock() so modular lockd builds</title>
<updated>2008-04-25T22:49:46+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>rdreier@cisco.com</email>
</author>
<published>2008-04-25T22:32:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=3dd7b71ca0f7ff8410a6b8cb15e5f670f90181e4'/>
<id>3dd7b71ca0f7ff8410a6b8cb15e5f670f90181e4</id>
<content type='text'>
Commit 1a747ee0 ("locks: don't call -&gt;copy_lock methods on return of
conflicting locks") changed fs/lockd/svclock.c to call
__locks_copy_lock() instead of locks_copy_lock(), but lockd can be built
as a module and __locks_copy_lock() is not exported, which causes a
build error

    ERROR: "__locks_copy_lock" [fs/lockd/lockd.ko] undefined!

with CONFIG_LOCKD=m.

Fix this by exporting __locks_copy_lock().

Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 1a747ee0 ("locks: don't call -&gt;copy_lock methods on return of
conflicting locks") changed fs/lockd/svclock.c to call
__locks_copy_lock() instead of locks_copy_lock(), but lockd can be built
as a module and __locks_copy_lock() is not exported, which causes a
build error

    ERROR: "__locks_copy_lock" [fs/lockd/lockd.ko] undefined!

with CONFIG_LOCKD=m.

Fix this by exporting __locks_copy_lock().

Signed-off-by: Roland Dreier &lt;rolandd@cisco.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>locks: don't call -&gt;copy_lock methods on return of conflicting locks</title>
<updated>2008-04-25T17:00:11+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@citi.umich.edu</email>
</author>
<published>2008-04-24T14:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1a747ee0cc11a198f9e2435add821bd0dfedb7c1'/>
<id>1a747ee0cc11a198f9e2435add821bd0dfedb7c1</id>
<content type='text'>
The file_lock structure is used both as a heavy-weight representation of
an active lock, with pointers to reference-counted structures, etc., and
as a simple container for parameters that describe a file lock.

The conflicting lock returned from __posix_lock_file is an example of
the latter; so don't call the filesystem or lock manager callbacks when
copying to it.  This also saves the need for an unnecessary
locks_init_lock in the nfsv4 server.

Thanks to Trond for pointing out the error.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The file_lock structure is used both as a heavy-weight representation of
an active lock, with pointers to reference-counted structures, etc., and
as a simple container for parameters that describe a file lock.

The conflicting lock returned from __posix_lock_file is an example of
the latter; so don't call the filesystem or lock manager callbacks when
copying to it.  This also saves the need for an unnecessary
locks_init_lock in the nfsv4 server.

Thanks to Trond for pointing out the error.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>leases: remove unneeded variable from fcntl_setlease().</title>
<updated>2008-04-25T16:58:22+00:00</updated>
<author>
<name>David M. Richter</name>
<email>richterd@citi.umich.edu</email>
</author>
<published>2008-04-23T20:29:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9d91cdcc0cce3186742f38e7352459b2087fbb86'/>
<id>9d91cdcc0cce3186742f38e7352459b2087fbb86</id>
<content type='text'>
fcntl_setlease() has a struct dentry* that is used only once; this patch
removes it.

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fcntl_setlease() has a struct dentry* that is used only once; this patch
removes it.

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>leases: move lock allocation earlier in generic_setlease()</title>
<updated>2008-04-25T16:58:22+00:00</updated>
<author>
<name>David M. Richter</name>
<email>richterd@citi.umich.edu</email>
</author>
<published>2008-04-23T20:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=190855576743a510219fc67886dace29b825d8cb'/>
<id>190855576743a510219fc67886dace29b825d8cb</id>
<content type='text'>
In generic_setlease(), the struct file_lock is allocated after tests for the
presence of conflicting readers/writers is done, despite the fact that the
allocation might block; this patch moves the allocation earlier.  A subsequent
set of patches will rely on this behavior to properly serialize between a
modified __break_lease() and generic_setlease().

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In generic_setlease(), the struct file_lock is allocated after tests for the
presence of conflicting readers/writers is done, despite the fact that the
allocation might block; this patch moves the allocation earlier.  A subsequent
set of patches will rely on this behavior to properly serialize between a
modified __break_lease() and generic_setlease().

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>leases: when unlocking, skip locking-related steps</title>
<updated>2008-04-25T16:58:22+00:00</updated>
<author>
<name>David M. Richter</name>
<email>richterd@citi.umich.edu</email>
</author>
<published>2008-04-23T20:29:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=288b2fd8251cb0bcb14b8a93755ef9c78de70e0f'/>
<id>288b2fd8251cb0bcb14b8a93755ef9c78de70e0f</id>
<content type='text'>
In generic_setlease(), we don't need to allocate a new struct file_lock
or check for readers or writers when called with F_UNLCK.

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In generic_setlease(), we don't need to allocate a new struct file_lock
or check for readers or writers when called with F_UNLCK.

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>leases: fix a return-value mixup</title>
<updated>2008-04-25T16:58:22+00:00</updated>
<author>
<name>David M. Richter</name>
<email>richterd@citi.umich.edu</email>
</author>
<published>2008-04-23T20:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=5fcc60c3a05bf417229fba715e7aec52bf6717fb'/>
<id>5fcc60c3a05bf417229fba715e7aec52bf6717fb</id>
<content type='text'>
Fixes a return-value mixup from 85c59580b30c82aa771aa33b37217a6b6851bc14
"locks: Fix potential OOPS in generic_setlease()", in which -ENOMEM replaced
what had been intended to stay -EAGAIN in the variable "error".

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a return-value mixup from 85c59580b30c82aa771aa33b37217a6b6851bc14
"locks: Fix potential OOPS in generic_setlease()", in which -ENOMEM replaced
what had been intended to stay -EAGAIN in the variable "error".

Signed-off-by: David M. Richter &lt;richterd@citi.umich.edu&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: Remove unnecessary inclusions of asm/semaphore.h</title>
<updated>2008-04-19T02:16:44+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-02-26T14:59:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=cb688371e27880d86c42323826846d1cd7caad8f'/>
<id>cb688371e27880d86c42323826846d1cd7caad8f</id>
<content type='text'>
None of these files use any of the functionality promised by
asm/semaphore.h.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
None of these files use any of the functionality promised by
asm/semaphore.h.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
