<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfsd, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-03-23T21:55:25Z</updated>
<entry>
<title>NFSD: provide encode routine for OP_OPENATTR</title>
<updated>2009-03-23T21:55:25Z</updated>
<author>
<name>Benny Halevy</name>
</author>
<published>2009-03-04T21:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bddaa01c5da9aa6083218f0f4c991a12a8f8054'/>
<id>urn:sha1:2bddaa01c5da9aa6083218f0f4c991a12a8f8054</id>
<content type='text'>
commit 84f09f46b4ee9e4e9b6381f8af31817516d2091b upstream.

Although this operation is unsupported by our implementation
we still need to provide an encode routine for it to
merely encode its (error) status back in the compound reply.

Thanks for Bill Baker at sun.com for testing with the Sun
OpenSolaris' client, finding, and reporting this bug at
Connectathon 2009.

This bug was introduced in 2.6.27

Signed-off-by: Benny Halevy &lt;bhalevy@panasas.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT</title>
<updated>2009-02-06T21:47:20Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-12-20T19:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05b3cbed318b32175df7cfbafd0cac04cff6b776'/>
<id>urn:sha1:05b3cbed318b32175df7cfbafd0cac04cff6b776</id>
<content type='text'>
commit 55ef1274dddd4de387c54d110e354ffbb6cdc706 upstream.

Since nfsv4 allows LOCKT without an open, but the -&gt;lock() method is a
file method, we fake up a struct file in the nfsv4 code with just the
fields we need initialized.  But we forgot to initialize the file
operations, with the result that LOCKT never results in a call to the
filesystem's -&gt;lock() method (if it exists).

We could just add that one more initialization.  But this hack of faking
up a struct file with only some fields initialized seems the kind of
thing that might cause more problems in the future.  We should either do
an open and get a real struct file, or make lock-testing an inode (not a
file) method.

This patch does the former.

Reported-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Tested-by: Marc Eshel &lt;eshel@almaden.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nfsd: only set file_lock.fl_lmops in nfsd4_lockt if a stateowner is found</title>
<updated>2009-02-06T21:47:20Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2009-01-22T19:16:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d47d1c2e6541d2a53d9a2cfc41eec021ec8af95b'/>
<id>urn:sha1:d47d1c2e6541d2a53d9a2cfc41eec021ec8af95b</id>
<content type='text'>
commit fa82a491275a613b15489aab4b99acecb00958d3 upstream.

nfsd4_lockt does a search for a lockstateowner when building the lock
struct to test. If one is found, it'll set fl_owner to it. Regardless of
whether that happens, it'll also set fl_lmops. Given that this lock is
basically a "lightweight" lock that's just used for checking conflicts,
setting fl_lmops is probably not appropriate for it.

This behavior exposed a bug in DLM's GETLK implementation where it
wasn't clearing out the fields in the file_lock before filling in
conflicting lock info. While we were able to fix this in DLM, it
still seems pointless and dangerous to set the fl_lmops this way
when we may have a NULL lockstateowner.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@pig.fieldses.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nfsd: use of unitialized list head on error exit in nfs4recover.c</title>
<updated>2008-11-24T16:36:09Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-11-24T16:32:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4625eb826de4f6774ee602c442ba23b686bdcc7'/>
<id>urn:sha1:e4625eb826de4f6774ee602c442ba23b686bdcc7</id>
<content type='text'>
Thanks to Matthew Dodd for this bug report:

A file label issue while running SELinux in MLS mode provoked the
following bug, which is a result of use before init on a 'struct list_head'.

In nfsd4_list_rec_dir() if the call to dentry_open() fails the 'goto
out' skips INIT_LIST_HEAD() which results in the normally improbable
case where list_entry() returns NULL.

Trace follows.

NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
SELinux:  Context unconfined_t:object_r:var_lib_nfs_t:s0 is not valid
(left unmapped).
type=1400 audit(1227298063.609:282): avc:  denied  { read } for
pid=1890 comm="rpc.nfsd" name="v4recovery" dev=dm-0 ino=148726
scontext=system_u:system_r:nfsd_t:s0-s15:c0.c1023
tcontext=system_u:object_r:unlabeled_t:s15:c0.c1023 tclass=dir
BUG: unable to handle kernel NULL pointer dereference at 00000004
IP: [&lt;c050894e&gt;] list_del+0x6/0x60
*pde = 0d9ce067 *pte = 00000000
Oops: 0000 [#1] SMP
Modules linked in: nfsd lockd nfs_acl auth_rpcgss exportfs autofs4
sunrpc ipv6 dm_multipath scsi_dh ppdev parport_pc sg parport floppy
ata_piix pata_acpi ata_generic libata pcnet32 i2c_piix4 mii pcspkr
i2c_core dm_snapshot dm_zero dm_mirror dm_log dm_mod BusLogic sd_mod
scsi_mod crc_t10dif ext3 jbd mbcache uhci_hcd ohci_hcd ehci_hcd [last
unloaded: microcode]

Pid: 1890, comm: rpc.nfsd Not tainted (2.6.27.5-37.fc9.i686 #1)
EIP: 0060:[&lt;c050894e&gt;] EFLAGS: 00010217 CPU: 0
EIP is at list_del+0x6/0x60
EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: cd99e480
ESI: cf9caed8 EDI: 00000000 EBP: cf9caebc ESP: cf9caeb8
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process rpc.nfsd (pid: 1890, ti=cf9ca000 task=cf4de580 task.ti=cf9ca000)
Stack: 00000000 cf9caef0 d0a9f139 c0496d04 d0a9f217 fffffff3 00000000
00000000
        00000000 00000000 cf32b220 00000000 00000008 00000801 cf9caefc
d0a9f193
        00000000 cf9caf08 d0a9b6ea 00000000 cf9caf1c d0a874f2 cf9c3004
00000008
Call Trace:
  [&lt;d0a9f139&gt;] ? nfsd4_list_rec_dir+0xf3/0x13a [nfsd]
  [&lt;c0496d04&gt;] ? do_path_lookup+0x12d/0x175
  [&lt;d0a9f217&gt;] ? load_recdir+0x0/0x26 [nfsd]
  [&lt;d0a9f193&gt;] ? nfsd4_recdir_load+0x13/0x34 [nfsd]
  [&lt;d0a9b6ea&gt;] ? nfs4_state_start+0x2a/0xc5 [nfsd]
  [&lt;d0a874f2&gt;] ? nfsd_svc+0x51/0xff [nfsd]
  [&lt;d0a87f2d&gt;] ? write_svc+0x0/0x1e [nfsd]
  [&lt;d0a87f48&gt;] ? write_svc+0x1b/0x1e [nfsd]
  [&lt;d0a87854&gt;] ? nfsctl_transaction_write+0x3a/0x61 [nfsd]
  [&lt;c04b6a4e&gt;] ? sys_nfsservctl+0x116/0x154
  [&lt;c04975c1&gt;] ? putname+0x24/0x2f
  [&lt;c04975c1&gt;] ? putname+0x24/0x2f
  [&lt;c048d49f&gt;] ? do_sys_open+0xad/0xb7
  [&lt;c048d337&gt;] ? filp_close+0x50/0x5a
  [&lt;c048d4eb&gt;] ? sys_open+0x1e/0x26
  [&lt;c0403cca&gt;] ? syscall_call+0x7/0xb
  [&lt;c064007b&gt;] ? init_cyrix+0x185/0x490
  =======================
Code: 75 e1 8b 53 08 8d 4b 04 8d 46 04 e8 75 00 00 00 8b 53 10 8d 4b 0c
8d 46 0c e8 67 00 00 00 5b 5e 5f 5d c3 90 90 55 89 e5 53 89 c3 &lt;8b&gt; 40
04 8b 00 39 d8 74 16 50 53 68 3e d6 6f c0 6a 30 68 78 d6
EIP: [&lt;c050894e&gt;] list_del+0x6/0x60 SS:ESP 0068:cf9caeb8
---[ end trace a89c4ad091c4ad53 ]---

Cc: Matthew N. Dodd &lt;Matthew.Dodd@spart.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>nfsd: clean up grace period on early exit</title>
<updated>2008-11-24T16:12:48Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-11-20T20:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c5e76158fcea6e3b9536a74efa7b5e2e846d374'/>
<id>urn:sha1:2c5e76158fcea6e3b9536a74efa7b5e2e846d374</id>
<content type='text'>
If nfsd was shut down before the grace period ended, we could end up
with a freed object still on grace_list.  Thanks to Jeff Moyer for
reporting the resulting list corruption warnings.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Tested-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
</content>
</entry>
<entry>
<title>Fix nfsd truncation of readdir results</title>
<updated>2008-11-09T20:15:50Z</updated>
<author>
<name>Doug Nazar</name>
</author>
<published>2008-11-05T11:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b726e923ea4d216027e466aa602d914e4b4a63af'/>
<id>urn:sha1:b726e923ea4d216027e466aa602d914e4b4a63af</id>
<content type='text'>
Commit 8d7c4203 "nfsd: fix failure to set eof in readdir in some
situations" introduced a bug: on a directory in an exported ext3
filesystem with dir_index unset, a READDIR will only return about 250
entries, even if the directory was larger.

Bisected it back to this commit; reverting it fixes the problem.

It turns out that in this case ext3 reads a block at a time, then
returns from readdir, which means we can end up with buf.full==0 but
with more entries in the directory still to be read.  Before 8d7c4203
(but after c002a6c797 "Optimise NFS readdir hack slightly"), this would
cause us to return the READDIR result immediately, but with the eof bit
unset.  That could cause a performance regression (because the client
would need more roundtrips to the server to read the whole directory),
but no loss in correctness, since the cleared eof bit caused the client
to send another readdir.  After 8d7c4203, the setting of the eof bit
made this a correctness problem.

So, move nfserr_eof into the loop and remove the buf.full check so that
we loop until buf.used==0.  The following seems to do the right thing
and reduces the network traffic since we don't return a READDIR result
until the buffer is full.

Tested on an empty directory &amp; large directory; eof is properly sent and
there are no more short buffers.

Signed-off-by: Doug Nazar &lt;nazard@dragoninc.ca&gt;
Cc: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>nfsd: fix failure to set eof in readdir in some situations</title>
<updated>2008-10-30T21:16:49Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2008-10-30T17:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d7c4203c681a3ec359eccff4e53bc8c0ccf403b'/>
<id>urn:sha1:8d7c4203c681a3ec359eccff4e53bc8c0ccf403b</id>
<content type='text'>
Before 14f7dd632011bb89c035722edd6ea0d90ca6b078 "[PATCH] Copy XFS
readdir hack into nfsd code", readdir_cd-&gt;err was reset to eof before
each call to vfs_readdir; afterwards, it is set only once.  Similarly,
c002a6c7977320f95b5edede5ce4e0eeecf291ff "[PATCH] Optimise NFS readdir
hack slightly", can cause us to exit without nfserr_eof set.  Fix this.

This ensures the "eof" bit is set when needed in readdir replies.  (The
particular case I saw was an nfsv4 readdir of an empty directory, which
returned with no entries (the protocol requires "." and ".." to be
filtered out), but with eof unset.)

Cc: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6</title>
<updated>2008-10-23T17:22:40Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2008-10-23T17:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47'/>
<id>urn:sha1:5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (46 commits)
  [PATCH] fs: add a sanity check in d_free
  [PATCH] i_version: remount support
  [patch] vfs: make security_inode_setattr() calling consistent
  [patch 1/3] FS_MBCACHE: don't needlessly make it built-in
  [PATCH] move executable checking into -&gt;permission()
  [PATCH] fs/dcache.c: update comment of d_validate()
  [RFC PATCH] touch_mnt_namespace when the mount flags change
  [PATCH] reiserfs: add missing llseek method
  [PATCH] fix -&gt;llseek for more directories
  [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent
  [PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup
  [PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate()
  [PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper
  [PATCH vfs-2.6 2/6] vfs: add d_ancestor()
  [PATCH vfs-2.6 1/6] vfs: replace parent == dentry-&gt;d_parent by IS_ROOT()
  [PATCH] get rid of on-stack dentry in udf
  [PATCH 2/2] anondev: switch to IDA
  [PATCH 1/2] anondev: init IDR statically
  [JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup()
  [PATCH] Optimise NFS readdir hack slightly.
  ...
</content>
</entry>
<entry>
<title>[PATCH] Optimise NFS readdir hack slightly.</title>
<updated>2008-10-23T09:13:11Z</updated>
<author>
<name>David Woodhouse</name>
</author>
<published>2008-08-17T16:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c002a6c7977320f95b5edede5ce4e0eeecf291ff'/>
<id>urn:sha1:c002a6c7977320f95b5edede5ce4e0eeecf291ff</id>
<content type='text'>
Avoid calling the underlying -&gt;readdir() again when we reached the end
already; keep going round the loop only if we stopped due to our own
buffer being full.

[AV: tidy the things up a bit, while we are there]

Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>[PATCH] prepare vfs_readdir() callers to returning filldir result</title>
<updated>2008-10-23T09:13:10Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-08-24T11:29:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53c9c5c0e32c69f9df1822e47671c13e3402c82f'/>
<id>urn:sha1:53c9c5c0e32c69f9df1822e47671c13e3402c82f</id>
<content type='text'>
It's not the final state, but it allows moving -&gt;readdir() instances
to passing filldir return value to caller of vfs_readdir().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
