<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/locks.c, branch v2.6.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/locks.c?h=v2.6.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/locks.c?h=v2.6.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2006-10-02T14:57:14Z</updated>
<entry>
<title>[PATCH] file: modify struct fown_struct to use a struct pid</title>
<updated>2006-10-02T14:57:14Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-10-02T09:17:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=609d7fa9565c754428d2520cac2accc9052e1245'/>
<id>urn:sha1:609d7fa9565c754428d2520cac2accc9052e1245</id>
<content type='text'>
File handles can be requested to send sigio and sigurg to processes.  By
tracking the destination processes using struct pid instead of pid_t we make
the interface safe from all potential pid wrap around problems.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] VFS: Use SEEK_{SET, CUR, END} instead of hardcoded values</title>
<updated>2006-10-01T07:39:21Z</updated>
<author>
<name>Josef 'Jeff' Sipek</name>
<email>jeffpc@josefsipek.net</email>
</author>
<published>2006-10-01T06:27:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5579f8c7d7e2c9eb62b566c511b21091a778157'/>
<id>urn:sha1:f5579f8c7d7e2c9eb62b566c511b21091a778157</id>
<content type='text'>
VFS: Use SEEK_{SET,CUR,END} instead of hardcoded values

Signed-off-by: Josef 'Jeff' Sipek &lt;jeffpc@josefsipek.net&gt;
Acked-by: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] fcntl(F_SETSIG) fix</title>
<updated>2006-08-14T20:10:59Z</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@fys.uio.no</email>
</author>
<published>2006-08-14T15:54:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=74361cb6828398a96167b3234e186fbd731e5f30'/>
<id>urn:sha1:74361cb6828398a96167b3234e186fbd731e5f30</id>
<content type='text'>
fcntl(F_SETSIG) no longer works on leases because
lease_release_private_callback() gets called as the lease is copied in
order to initialise it.

The problem is that lease_alloc() performs an unnecessary initialisation,
which sets the lease_manager_ops.  Avoid the problem by allocating the
target lease structure using locks_alloc_lock().

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>VFS: Add support for the FL_ACCESS flag to flock_lock_file()</title>
<updated>2006-07-05T17:13:18Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-06-29T20:38:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62'/>
<id>urn:sha1:f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62</id>
<content type='text'>
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>VFS: Allow caller to determine if BSD or posix locks were actually freed</title>
<updated>2006-07-05T17:13:17Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-06-29T20:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f475ae957db66650db66916c62604ac27409d884'/>
<id>urn:sha1:f475ae957db66650db66916c62604ac27409d884</id>
<content type='text'>
Change posix_lock_file_conf(), and flock_lock_file() so that if called
with an F_UNLCK argument, and the FL_EXISTS flag they will indicate
whether or not any locks were actually freed by returning 0 or -ENOENT.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>[PATCH] fs/locks.c: make posix_locks_deadlock() static</title>
<updated>2006-06-23T14:43:03Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2006-06-23T09:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b0904e147f7cbe4be3b4dae49ddccd627bb66f16'/>
<id>urn:sha1:b0904e147f7cbe4be3b4dae49ddccd627bb66f16</id>
<content type='text'>
We can now make posix_locks_deadlock() static.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] vfs: add lock owner argument to flush operation</title>
<updated>2006-06-23T14:43:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-06-23T09:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=75e1fcc0b18df0a65ab113198e9dc0e98999a08c'/>
<id>urn:sha1:75e1fcc0b18df0a65ab113198e9dc0e98999a08c</id>
<content type='text'>
Pass the POSIX lock owner ID to the flush operation.

This is useful for filesystems which don't want to store any locking state
in inode-&gt;i_flock but want to handle locking/unlocking POSIX locks
internally.  FUSE is one such filesystem but I think it possible that some
network filesystems would need this also.

Also add a flag to indicate that a POSIX locking request was generated by
close(), so filesystems using the above feature won't send an extra locking
request in this case.

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] locks: clean up locks_remove_posix()</title>
<updated>2006-06-23T14:43:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-06-23T09:05:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff7b86b82083f24b8637dff1528c7101c18c7f39'/>
<id>urn:sha1:ff7b86b82083f24b8637dff1528c7101c18c7f39</id>
<content type='text'>
locks_remove_posix() can use posix_lock_file() instead of doing the lock
removal by hand.  posix_lock_file() now does exacly the same.

The comment about pids no longer applies, posix_lock_file() takes only the
owner into account.

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] locks: don't do unnecessary allocations</title>
<updated>2006-06-23T14:43:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-06-23T09:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=39005d022ad221b76dc2de0ac62ef475a796433b'/>
<id>urn:sha1:39005d022ad221b76dc2de0ac62ef475a796433b</id>
<content type='text'>
posix_lock_file() always allocates new locks in advance, even if it's easy to
determine that no allocations will be needed.

Optimize these cases:

 - FL_ACCESS flag is set

 - Unlocking the whole range

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] locks: don't unnecessarily fail posix lock operations</title>
<updated>2006-06-23T14:43:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>miklos@szeredi.hu</email>
</author>
<published>2006-06-23T09:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0d9a490abe1f69fda220f7866f6f23af41daa128'/>
<id>urn:sha1:0d9a490abe1f69fda220f7866f6f23af41daa128</id>
<content type='text'>
posix_lock_file() was too cautious, failing operations on OOM, even if they
didn't actually require an allocation.

This has the disadvantage, that a failing unlock on process exit could lead to
a memory leak.  There are two possibilites for this:

- filesystem implements .lock() and calls back to posix_lock_file().  On
cleanup of files_struct locks_remove_posix() is called which should remove all
locks belonging to files_struct.  However if filesystem calls
posix_lock_file() which fails, then those locks will never be freed.

- if a file is closed while a lock is blocked, then after acquiring
fcntl_setlk() will undo the lock.  But this unlock itself might fail on OOM,
again possibly leaking the lock.

The solution is to move the checking of the allocations until after it is sure
that they will be needed.  This will solve the above problem since unlock will
always succeed unless it splits an existing region.

Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
