<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/lockd, branch v3.16</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/lockd?h=v3.16</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/lockd?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-06-10T18:50:57Z</updated>
<entry>
<title>Merge branch 'for-3.16' of git://linux-nfs.org/~bfields/linux</title>
<updated>2014-06-10T18:50:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-06-10T18:50:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5b174fd6472b1d6b6402b30210a212f3fd770d96'/>
<id>urn:sha1:5b174fd6472b1d6b6402b30210a212f3fd770d96</id>
<content type='text'>
Pull nfsd updates from Bruce Fields:
 "The largest piece is a long-overdue rewrite of the xdr code to remove
  some annoying limitations: for example, there was no way to return
  ACLs larger than 4K, and readdir results were returned only in 4k
  chunks, limiting performance on large directories.

  Also:
        - part of Neil Brown's work to make NFS work reliably over the
          loopback interface (so client and server can run on the same
          machine without deadlocks).  The rest of it is coming through
          other trees.
        - cleanup and bugfixes for some of the server RDMA code, from
          Steve Wise.
        - Various cleanup of NFSv4 state code in preparation for an
          overhaul of the locking, from Jeff, Trond, and Benny.
        - smaller bugfixes and cleanup from Christoph Hellwig and
          Kinglong Mee.

  Thanks to everyone!

  This summer looks likely to be busier than usual for knfsd.  Hopefully
  we won't break it too badly; testing definitely welcomed"

* 'for-3.16' of git://linux-nfs.org/~bfields/linux: (100 commits)
  nfsd4: fix FREE_STATEID lockowner leak
  svcrdma: Fence LOCAL_INV work requests
  svcrdma: refactor marshalling logic
  nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry
  nfs4: remove unused CHANGE_SECURITY_LABEL
  nfsd4: kill READ64
  nfsd4: kill READ32
  nfsd4: simplify server xdr-&gt;next_page use
  nfsd4: hash deleg stateid only on successful nfs4_set_delegation
  nfsd4: rename recall_lock to state_lock
  nfsd: remove unneeded zeroing of fields in nfsd4_proc_compound
  nfsd: fix setting of NFS4_OO_CONFIRMED in nfsd4_open
  nfsd4: use recall_lock for delegation hashing
  nfsd: fix laundromat next-run-time calculation
  nfsd: make nfsd4_encode_fattr static
  SUNRPC/NFSD: Remove using of dprintk with KERN_WARNING
  nfsd: remove unused function nfsd_read_file
  nfsd: getattr for FATTR4_WORD0_FILES_AVAIL needs the statfs buffer
  NFSD: Error out when getting more than one fsloc/secinfo/uuid
  NFSD: Using type of uint32_t for ex_nflavors instead of int
  ...
</content>
</entry>
<entry>
<title>lockd: convert use of typedef ctl_table to struct ctl_table</title>
<updated>2014-06-06T23:08:16Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2014-06-06T21:38:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7ac9fe571d96a3c5b19d9374cf5c4e445a8690df'/>
<id>urn:sha1:7ac9fe571d96a3c5b19d9374cf5c4e445a8690df</id>
<content type='text'>
This typedef is unnecessary and should just be removed.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: move &lt;linux/nfsd/export.h&gt; to fs/nfsd</title>
<updated>2014-05-06T21:54:54Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-05-06T17:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d430e8d530e900c923bf77718d72478b1c280592'/>
<id>urn:sha1:d430e8d530e900c923bf77718d72478b1c280592</id>
<content type='text'>
There are no legitimate users outside of fs/nfsd, so move it there.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd: remove &lt;linux/nfsd/nfsfh.h&gt;</title>
<updated>2014-05-06T21:54:53Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-05-06T17:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9c69de4c94fcb11db919160d5fa0b48f13d1757a'/>
<id>urn:sha1:9c69de4c94fcb11db919160d5fa0b48f13d1757a</id>
<content type='text'>
The only real user of this header is fs/nfsd/nfsfh.h, so merge the
two.  Various lockѕ source files used it to indirectly get other
sunrpc or nfs headers, so fix those up.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>lockd: avoid warning when CONFIG_SYSCTL undefined</title>
<updated>2014-05-06T21:54:52Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2014-05-01T21:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=12dd7ecf2323c572b1d302707eada4900848dced'/>
<id>urn:sha1:12dd7ecf2323c572b1d302707eada4900848dced</id>
<content type='text'>
When building without CONFIG_SYSCTL, the compiler saw an unused
label. This moves the label into the #ifdef it is used under.

fs/lockd/svc.c: In function ‘init_nlm’:
fs/lockd/svc.c:626:1: warning: label ‘err_sysctl’ defined but not used [-Wunused-label]

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>lockd: ensure we tear down any live sockets when socket creation fails during lockd_up</title>
<updated>2014-03-28T14:43:08Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2014-03-25T18:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=679b033df48422191c4cac52b610d9980e019f9b'/>
<id>urn:sha1:679b033df48422191c4cac52b610d9980e019f9b</id>
<content type='text'>
We had a Fedora ABRT report with a stack trace like this:

kernel BUG at net/sunrpc/svc.c:550!
invalid opcode: 0000 [#1] SMP
[...]
CPU: 2 PID: 913 Comm: rpc.nfsd Not tainted 3.13.6-200.fc20.x86_64 #1
Hardware name: Hewlett-Packard HP ProBook 4740s/1846, BIOS 68IRR Ver. F.40 01/29/2013
task: ffff880146b00000 ti: ffff88003f9b8000 task.ti: ffff88003f9b8000
RIP: 0010:[&lt;ffffffffa0305fa8&gt;]  [&lt;ffffffffa0305fa8&gt;] svc_destroy+0x128/0x130 [sunrpc]
RSP: 0018:ffff88003f9b9de0  EFLAGS: 00010206
RAX: ffff88003f829628 RBX: ffff88003f829600 RCX: 00000000000041ee
RDX: 0000000000000000 RSI: 0000000000000286 RDI: 0000000000000286
RBP: ffff88003f9b9de8 R08: 0000000000017360 R09: ffff88014fa97360
R10: ffffffff8114ce57 R11: ffffea00051c9c00 R12: ffff88003f829600
R13: 00000000ffffff9e R14: ffffffff81cc7cc0 R15: 0000000000000000
FS:  00007f4fde284840(0000) GS:ffff88014fa80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4fdf5192f8 CR3: 00000000a569a000 CR4: 00000000001407e0
Stack:
 ffff88003f792300 ffff88003f9b9e18 ffffffffa02de02a 0000000000000000
 ffffffff81cc7cc0 ffff88003f9cb000 0000000000000008 ffff88003f9b9e60
 ffffffffa033bb35 ffffffff8131c86c ffff88003f9cb000 ffff8800a5715008
Call Trace:
 [&lt;ffffffffa02de02a&gt;] lockd_up+0xaa/0x330 [lockd]
 [&lt;ffffffffa033bb35&gt;] nfsd_svc+0x1b5/0x2f0 [nfsd]
 [&lt;ffffffff8131c86c&gt;] ? simple_strtoull+0x2c/0x50
 [&lt;ffffffffa033c630&gt;] ? write_pool_threads+0x280/0x280 [nfsd]
 [&lt;ffffffffa033c6bb&gt;] write_threads+0x8b/0xf0 [nfsd]
 [&lt;ffffffff8114efa4&gt;] ? __get_free_pages+0x14/0x50
 [&lt;ffffffff8114eff6&gt;] ? get_zeroed_page+0x16/0x20
 [&lt;ffffffff811dec51&gt;] ? simple_transaction_get+0xb1/0xd0
 [&lt;ffffffffa033c098&gt;] nfsctl_transaction_write+0x48/0x80 [nfsd]
 [&lt;ffffffff811b8b34&gt;] vfs_write+0xb4/0x1f0
 [&lt;ffffffff811c3f99&gt;] ? putname+0x29/0x40
 [&lt;ffffffff811b9569&gt;] SyS_write+0x49/0xa0
 [&lt;ffffffff810fc2a6&gt;] ? __audit_syscall_exit+0x1f6/0x2a0
 [&lt;ffffffff816962e9&gt;] system_call_fastpath+0x16/0x1b
Code: 31 c0 e8 82 db 37 e1 e9 2a ff ff ff 48 8b 07 8b 57 14 48 c7 c7 d5 c6 31 a0 48 8b 70 20 31 c0 e8 65 db 37 e1 e9 f4 fe ff ff 0f 0b &lt;0f&gt; 0b 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55
RIP  [&lt;ffffffffa0305fa8&gt;] svc_destroy+0x128/0x130 [sunrpc]
 RSP &lt;ffff88003f9b9de0&gt;

Evidently, we created some lockd sockets and then failed to create
others. make_socks then returned an error and we tried to tear down the
svc, but svc-&gt;sv_permsocks was not empty so we ended up tripping over
the BUG() in svc_destroy().

Fix this by ensuring that we tear down any live sockets we created when
socket creation is going to return an error.

Fixes: 786185b5f8abefa (SUNRPC: move per-net operations from...)
Reported-by: Raphos &lt;raphoszap@laposte.net&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Stanislav Kinsbursky &lt;skinsbursky@parallels.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>lockd: send correct lock when granting a delayed lock.</title>
<updated>2014-02-13T19:55:02Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-02-07T06:10:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ec197db1a56c9269d75e965f14c344b58b2a4f6'/>
<id>urn:sha1:2ec197db1a56c9269d75e965f14c344b58b2a4f6</id>
<content type='text'>
If an NFS client attempts to get a lock (using NLM) and the lock is
not available, the server will remember the request and when the lock
becomes available it will send a GRANT request to the client to
provide the lock.

If the client already held an adjacent lock, the GRANT callback will
report the union of the existing and new locks, which can confuse the
client.

This happens because __posix_lock_file (called by vfs_lock_file)
updates the passed-in file_lock structure when adjacent or
over-lapping locks are found.

To avoid this problem we take a copy of the two fields that can
be changed (fl_start and fl_end) before the call and restore them
afterwards.
An alternate would be to allocate a 'struct file_lock', initialise it,
use locks_copy_lock() to take a copy, then locks_release_private()
after the vfs_lock_file() call.  But that is a lot more work.

Reported-by: Olaf Kirch &lt;okir@suse.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;

--
v1 had a couple of issues (large on-stack struct and didn't really work properly).
This version is much better tested.
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>LOCKD: Don't call utsname()-&gt;nodename from nlmclnt_setlockargs</title>
<updated>2013-08-05T19:03:46Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2013-08-05T16:06:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9a1b6bf818e74bb7aabaecb59492b739f2f4d742'/>
<id>urn:sha1:9a1b6bf818e74bb7aabaecb59492b739f2f4d742</id>
<content type='text'>
Firstly, nlmclnt_setlockargs can be called from a reclaimer thread, in
which case we're in entirely the wrong namespace.

Secondly, commit 8aac62706adaaf0fab02c4327761561c8bda9448 (move
exit_task_namespaces() outside of exit_notify()) now means that
exit_task_work() is called after exit_task_namespaces(), which
triggers an Oops when we're freeing up the locks.

Fix this by ensuring that we initialise the nlm_host's rpc_client at mount
time, so that the cl_nodename field is initialised to the value of
utsname()-&gt;nodename that the net namespace uses. Then replace the
lockd callers of utsname()-&gt;nodename.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Cc: Toralf Förster &lt;toralf.foerster@gmx.de&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Nix &lt;nix@esperi.org.uk&gt;
Cc: Jeff Layton &lt;jlayton@redhat.com&gt;
Cc: stable@vger.kernel.org # 3.10.x
</content>
</entry>
<entry>
<title>Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux</title>
<updated>2013-07-17T20:43:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-07-17T20:43:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=61f98b0fca802d7e0191072606519e2230a6226d'/>
<id>urn:sha1:61f98b0fca802d7e0191072606519e2230a6226d</id>
<content type='text'>
Pull nfsd bugfixes from Bruce Fields:
 "Just three minor bugfixes"

* 'for-3.11' of git://linux-nfs.org/~bfields/linux:
  svcrdma: underflow issue in decode_write_list()
  nfsd4: fix minorversion support interface
  lockd: protect nlm_blocked access in nlmsvc_retry_blocked
</content>
</entry>
<entry>
<title>lockd: protect nlm_blocked access in nlmsvc_retry_blocked</title>
<updated>2013-07-11T21:24:07Z</updated>
<author>
<name>David Jeffery</name>
<email>djeffery@redhat.com</email>
</author>
<published>2013-07-10T17:19:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1c327d962fc420aea046c16215a552710bde8231'/>
<id>urn:sha1:1c327d962fc420aea046c16215a552710bde8231</id>
<content type='text'>
In nlmsvc_retry_blocked, the check that the list is non-empty and acquiring
the pointer of the first entry is unprotected by any lock.  This allows a rare
race condition when there is only one entry on the list.  A function such as
nlmsvc_grant_callback() can be called, which will temporarily remove the entry
from the list.  Between the list_empty() and list_entry(),the list may become
empty, causing an invalid pointer to be used as an nlm_block, leading to a
possible crash.

This patch adds the nlm_block_lock around these calls to prevent concurrent
use of the nlm_blocked list.

This was a regression introduced by
f904be9cc77f361d37d71468b13ff3d1a1823dea  "lockd: Mostly remove BKL from
the server".

Cc: Bryan Schumaker &lt;bjschuma@netapp.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: David Jeffery &lt;djeffery@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
</feed>
