<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/nfsd, branch v4.0.3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>nfsd: fix nsfd startup race triggering BUG_ON</title>
<updated>2015-05-06T20:04:05+00:00</updated>
<author>
<name>Giuseppe Cantavenera</name>
<email>giuseppe.cantavenera.ext@nokia.com</email>
</author>
<published>2015-04-20T16:00:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5d30089c2a59d079a074eb37c8c223b81664ceb'/>
<id>d5d30089c2a59d079a074eb37c8c223b81664ceb</id>
<content type='text'>
commit bb7ffbf29e76b89a86ca4c3ee0d4690641f2f772 upstream.

nfsd triggered a BUG_ON in net_generic(...) when rpc_pipefs_event(...)
in fs/nfsd/nfs4recover.c was called before assigning ntfsd_net_id.
The following was observed on a MIPS 32-core processor:
kernel: Call Trace:
kernel: [&lt;ffffffffc00bc5e4&gt;] rpc_pipefs_event+0x7c/0x158 [nfsd]
kernel: [&lt;ffffffff8017a2a0&gt;] notifier_call_chain+0x70/0xb8
kernel: [&lt;ffffffff8017a4e4&gt;] __blocking_notifier_call_chain+0x4c/0x70
kernel: [&lt;ffffffff8053aff8&gt;] rpc_fill_super+0xf8/0x1a0
kernel: [&lt;ffffffff8022204c&gt;] mount_ns+0xb4/0xf0
kernel: [&lt;ffffffff80222b48&gt;] mount_fs+0x50/0x1f8
kernel: [&lt;ffffffff8023dc00&gt;] vfs_kern_mount+0x58/0xf0
kernel: [&lt;ffffffff802404ac&gt;] do_mount+0x27c/0xa28
kernel: [&lt;ffffffff80240cf0&gt;] SyS_mount+0x98/0xe8
kernel: [&lt;ffffffff80135d24&gt;] handle_sys64+0x44/0x68
kernel:
kernel:
        Code: 0040f809  00000000  2e020001 &lt;00020336&gt; 3c12c00d
                3c02801a  de100000 6442eb98  0040f809
kernel: ---[ end trace 7471374335809536 ]---

Fixed this behaviour by calling register_pernet_subsys(&amp;nfsd_net_ops) before
registering rpc_pipefs_event(...) with the notifier chain.

Signed-off-by: Giuseppe Cantavenera &lt;giuseppe.cantavenera.ext@nokia.com&gt;
Signed-off-by: Lorenzo Restelli &lt;lorenzo.restelli.ext@nokia.com&gt;
Reviewed-by: Kinlong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bb7ffbf29e76b89a86ca4c3ee0d4690641f2f772 upstream.

nfsd triggered a BUG_ON in net_generic(...) when rpc_pipefs_event(...)
in fs/nfsd/nfs4recover.c was called before assigning ntfsd_net_id.
The following was observed on a MIPS 32-core processor:
kernel: Call Trace:
kernel: [&lt;ffffffffc00bc5e4&gt;] rpc_pipefs_event+0x7c/0x158 [nfsd]
kernel: [&lt;ffffffff8017a2a0&gt;] notifier_call_chain+0x70/0xb8
kernel: [&lt;ffffffff8017a4e4&gt;] __blocking_notifier_call_chain+0x4c/0x70
kernel: [&lt;ffffffff8053aff8&gt;] rpc_fill_super+0xf8/0x1a0
kernel: [&lt;ffffffff8022204c&gt;] mount_ns+0xb4/0xf0
kernel: [&lt;ffffffff80222b48&gt;] mount_fs+0x50/0x1f8
kernel: [&lt;ffffffff8023dc00&gt;] vfs_kern_mount+0x58/0xf0
kernel: [&lt;ffffffff802404ac&gt;] do_mount+0x27c/0xa28
kernel: [&lt;ffffffff80240cf0&gt;] SyS_mount+0x98/0xe8
kernel: [&lt;ffffffff80135d24&gt;] handle_sys64+0x44/0x68
kernel:
kernel:
        Code: 0040f809  00000000  2e020001 &lt;00020336&gt; 3c12c00d
                3c02801a  de100000 6442eb98  0040f809
kernel: ---[ end trace 7471374335809536 ]---

Fixed this behaviour by calling register_pernet_subsys(&amp;nfsd_net_ops) before
registering rpc_pipefs_event(...) with the notifier chain.

Signed-off-by: Giuseppe Cantavenera &lt;giuseppe.cantavenera.ext@nokia.com&gt;
Signed-off-by: Lorenzo Restelli &lt;lorenzo.restelli.ext@nokia.com&gt;
Reviewed-by: Kinlong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: eliminate NFSD_DEBUG</title>
<updated>2015-05-06T20:04:05+00:00</updated>
<author>
<name>Mark Salter</name>
<email>msalter@redhat.com</email>
</author>
<published>2015-04-06T13:46:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1f8303c597803d7d7c6943708dff333dbbc009a1'/>
<id>1f8303c597803d7d7c6943708dff333dbbc009a1</id>
<content type='text'>
commit 135dd002c23054aaa056ea3162c1e0356905c195 upstream.

Commit f895b252d4edf ("sunrpc: eliminate RPC_DEBUG") introduced
use of IS_ENABLED() in a uapi header which leads to a build
failure for userspace apps trying to use &lt;linux/nfsd/debug.h&gt;:

   linux/nfsd/debug.h:18:15: error: missing binary operator before token "("
  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
                ^

Since this was only used to define NFSD_DEBUG if CONFIG_SUNRPC_DEBUG
is enabled, replace instances of NFSD_DEBUG with CONFIG_SUNRPC_DEBUG.

Fixes: f895b252d4edf "sunrpc: eliminate RPC_DEBUG"
Signed-off-by: Mark Salter &lt;msalter@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 135dd002c23054aaa056ea3162c1e0356905c195 upstream.

Commit f895b252d4edf ("sunrpc: eliminate RPC_DEBUG") introduced
use of IS_ENABLED() in a uapi header which leads to a build
failure for userspace apps trying to use &lt;linux/nfsd/debug.h&gt;:

   linux/nfsd/debug.h:18:15: error: missing binary operator before token "("
  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
                ^

Since this was only used to define NFSD_DEBUG if CONFIG_SUNRPC_DEBUG
is enabled, replace instances of NFSD_DEBUG with CONFIG_SUNRPC_DEBUG.

Fixes: f895b252d4edf "sunrpc: eliminate RPC_DEBUG"
Signed-off-by: Mark Salter &lt;msalter@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd4: disallow SEEK with special stateids</title>
<updated>2015-05-06T20:04:05+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2015-04-21T19:25:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6fd154a83b18bc81aa3f1071e74c36d9076ff4b9'/>
<id>6fd154a83b18bc81aa3f1071e74c36d9076ff4b9</id>
<content type='text'>
commit 980608fb50aea34993ba956b71cd4602aa42b14b upstream.

If the client uses a special stateid then we'll pass a NULL file to
vfs_llseek.

Fixes: 24bab491220f " NFSD: Implement SEEK"
Cc: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Reported-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 980608fb50aea34993ba956b71cd4602aa42b14b upstream.

If the client uses a special stateid then we'll pass a NULL file to
vfs_llseek.

Fixes: 24bab491220f " NFSD: Implement SEEK"
Cc: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Reported-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd4: fix READ permission checking</title>
<updated>2015-05-06T20:04:05+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2015-04-03T21:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e2efc21fbad9a8d055586716fad4d4baaf210b56'/>
<id>e2efc21fbad9a8d055586716fad4d4baaf210b56</id>
<content type='text'>
commit 6e4891dc289cd191d46ab7ba1dcb29646644f9ca upstream.

In the case we already have a struct file (derived from a stateid), we
still need to do permission-checking; otherwise an unauthorized user
could gain access to a file by sniffing or guessing somebody else's
stateid.

Fixes: dc97618ddda9 "nfsd4: separate splice and readv cases"
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6e4891dc289cd191d46ab7ba1dcb29646644f9ca upstream.

In the case we already have a struct file (derived from a stateid), we
still need to do permission-checking; otherwise an unauthorized user
could gain access to a file by sniffing or guessing somebody else's
stateid.

Fixes: dc97618ddda9 "nfsd4: separate splice and readv cases"
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd4: disallow ALLOCATE with special stateids</title>
<updated>2015-05-06T20:04:04+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2015-04-03T20:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2556cb4a63a559a09112aba49d0112bd7dc4d2d6'/>
<id>2556cb4a63a559a09112aba49d0112bd7dc4d2d6</id>
<content type='text'>
commit 5ba4a25ab7b13be528b23f85182f4d09cf7f71ad upstream.

vfs_fallocate will hit a NULL dereference if the client tries an
ALLOCATE or DEALLOCATE with a special stateid.  Fix that.  (We also
depend on the open to have broken any conflicting leases or delegations
for us.)

(If it turns out we need to allow special stateid's then we could do a
temporary open here in the special-stateid case, as we do for read and
write.  For now I'm assuming it's not necessary.)

Fixes: 95d871f03cae "nfsd: Add ALLOCATE support"
Cc: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5ba4a25ab7b13be528b23f85182f4d09cf7f71ad upstream.

vfs_fallocate will hit a NULL dereference if the client tries an
ALLOCATE or DEALLOCATE with a special stateid.  Fix that.  (We also
depend on the open to have broken any conflicting leases or delegations
for us.)

(If it turns out we need to allow special stateid's then we could do a
temporary open here in the special-stateid case, as we do for read and
write.  For now I'm assuming it's not necessary.)

Fixes: 95d871f03cae "nfsd: Add ALLOCATE support"
Cc: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: require an explicit option to enable pNFS</title>
<updated>2015-03-30T20:05:26+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-03-30T16:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f3f03330dee0526d82f2a0fd1a79d207ed1ac439'/>
<id>f3f03330dee0526d82f2a0fd1a79d207ed1ac439</id>
<content type='text'>
Turns out sending out layouts to any client is a bad idea if they
can't get at the storage device, so require explicit admin action
to enable pNFS.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out sending out layouts to any client is a bad idea if they
can't get at the storage device, so require explicit admin action
to enable pNFS.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>NFSD: Fix bad update of layout in nfsd4_return_file_layout</title>
<updated>2015-03-26T01:13:03+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-03-22T14:17:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7890203da2cb9b861dae9bdb88f882f3e03baec9'/>
<id>7890203da2cb9b861dae9bdb88f882f3e03baec9</id>
<content type='text'>
With return layout as, (seg is return layout, lo is record layout)
seg-&gt;offset &lt;= lo-&gt;offset and layout_end(seg) &lt; layout_end(lo),
nfsd should update lo's offset to seg's end,
and,
seg-&gt;offset &gt; lo-&gt;offset and layout_end(seg) &gt;= layout_end(lo),
nfsd should update lo's end to seg's offset.

Fixes: 9cf514ccfa ("nfsd: implement pNFS operations")
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With return layout as, (seg is return layout, lo is record layout)
seg-&gt;offset &lt;= lo-&gt;offset and layout_end(seg) &lt; layout_end(lo),
nfsd should update lo's offset to seg's end,
and,
seg-&gt;offset &gt; lo-&gt;offset and layout_end(seg) &gt;= layout_end(lo),
nfsd should update lo's end to seg's offset.

Fixes: 9cf514ccfa ("nfsd: implement pNFS operations")
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>NFSD: Take care the return value from nfsd4_encode_stateid</title>
<updated>2015-03-26T01:13:02+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-03-22T14:17:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=376675daeac3dc0e39b84ca90f0bdc41a9d44d46'/>
<id>376675daeac3dc0e39b84ca90f0bdc41a9d44d46</id>
<content type='text'>
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>NFSD: Printk blocklayout length and offset as format 0x%llx</title>
<updated>2015-03-26T01:13:02+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-03-22T14:16:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=853695230e9847445ad42c330d023fca2324fd56'/>
<id>853695230e9847445ad42c330d023fca2324fd56</id>
<content type='text'>
When testing pnfs with nfsd_debug on, nfsd print a negative number
of layout length and foff in nfsd4_block_proc_layoutget as,
"GET: -xxxx:-xxx 2"

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When testing pnfs with nfsd_debug on, nfsd print a negative number
of layout length and foff in nfsd4_block_proc_layoutget as,
"GET: -xxxx:-xxx 2"

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: return correct lockowner when there is a race on hash insert</title>
<updated>2015-03-26T01:06:16+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2015-03-23T15:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=340f0ba1c6c8412aa35fd6476044836b84361ea6'/>
<id>340f0ba1c6c8412aa35fd6476044836b84361ea6</id>
<content type='text'>
alloc_init_lock_stateowner can return an already freed entry if there is
a race to put openowners in the hashtable.

Noticed by inspection after Jeff Layton fixed the same bug for open
owners.  Depending on client behavior, this one may be trickier to
trigger in practice.

Fixes: c58c6610ec24 "nfsd: Protect adding/removing lock owners using client_lock"
Cc: &lt;stable@vger.kernel.org&gt;
Cc: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Acked-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
alloc_init_lock_stateowner can return an already freed entry if there is
a race to put openowners in the hashtable.

Noticed by inspection after Jeff Layton fixed the same bug for open
owners.  Depending on client behavior, this one may be trickier to
trigger in practice.

Fixes: c58c6610ec24 "nfsd: Protect adding/removing lock owners using client_lock"
Cc: &lt;stable@vger.kernel.org&gt;
Cc: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Acked-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
