[PATCH 019 of 20] knfsd: nfsd: allow auth_sys nlm on rpcsec_gss exports

2007-07-09 Thread NeilBrown
From: J. Bruce Fields <[EMAIL PROTECTED]> Our clients (like other clients, as far as I know) use only auth_sys for nlm, even when using rpcsec_gss for the main nfs operations. Administrators that want to deny non-kerberos-authenticated locking requests will need to turn off NFS protocol versions

[PATCH 020 of 20] knfsd: nfsd: enforce per-flavor id squashing

2007-07-09 Thread NeilBrown
From: J. Bruce Fields <[EMAIL PROTECTED]> Allow root squashing to vary per-pseudoflavor, so that you can (for example) allow root access only when sufficiently strong security is in use. Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffs

[PATCH 000 of 8] knfsd: cleanups for exportfs code.

2007-05-15 Thread NeilBrown
the two filesystems that still use it (including jfs: hence the Cc to [EMAIL PROTECTED]). These are for -mm until 2.6.23 opens. NeilBrown [PATCH 001 of 8] knfsd: exportfs: add exportfs.h header [PATCH 002 of 8] knfsd: exportfs: remove iget abuse [PATCH 003 of 8] knfsd: exportfs: add procedura

[PATCH 001 of 8] knfsd: exportfs: add exportfs.h header

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> currently the export_operation structure and helpers related to it are in fs.h. fs.h is already far too large and there are very few places needing the export bits, so split them off into a separate header. Signed-off-by: Christoph Hellwig <[EMAIL PR

[PATCH 003 of 8] knfsd: exportfs: add procedural interface for NFSD

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> Currently NFSD calls directly into filesystems through the export_operations structure. I plan to change this interface in various ways in later patches, and want to avoid the export of the default operations to NFSD, so this patch adds two simple expo

[PATCH 002 of 8] knfsd: exportfs: remove iget abuse

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> When the exportfs interface was added the expectation was that filesystems provide an operation to convert from a file handle to an inode/dentry, but it kept a backwards compat option that still calls into iget. Calling into iget from non-filesystem co

[PATCH 004 of 8] knfsd: exportfs: remove CALL macro

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> Currently exportfs uses a way to call methods very differently from the rest of the kernel. This patch changes it to the standard conventions for method calls. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PRO

[PATCH 005 of 8] knfsd: exportfs: untangle ISDIR logic in find_exported_dentry

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> Rework some logic in find_exported_dentry so that we only have a single S_ISDIR check and logic that makes clear to the reader what we're really doing here. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECT

[PATCH 006 of 8] knfsd: exportfs: move acceptable check into find_acceptable_alias

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> All callers of find_acceptable_alias check if the current dentry is acceptable before looking for other acceptable aliases using find_acceptable_alias. Move the check into find_acceptable_alias to make the code a little more dense and add a comment to

[PATCH 007 of 8] knfsd: exportfs: add find_disconnected_root helper

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> Break the loop that finds the root of a disconnected subtree into a helper of its own to make reading easier and document the intent. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat outp

[PATCH 008 of 8] knfsd: exportfs: split out reconnecting a dentry from find_exported_dentry.

2007-05-15 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> There's a clear subfunctionality of reconnecting a given dentry to the main dentry tree in find_exported_dentry, that can be called both for the dentry we're looking for or it's parent directory. This patch splits the subfunctionality out into a separa

[PATCH 000 of 2] Fix some bugs with 'read' racing with 'truncate'

2007-06-06 Thread NeilBrown
tle, so I don't think there is any rush for them to go into 2.6.22. Rather they should sit in -mm at least until .23 opens up. Thanks, NeilBrown [PATCH 001 of 2] Fix read/truncate race. [PATCH 002 of 2] Make sure readv stops reading when it hits end-of-file. - To unsubscribe from this

[PATCH 002 of 2] Make sure readv stops reading when it hits end-of-file.

2007-06-06 Thread NeilBrown
The do_loop_readv_writev implementation of readv breaks out of the loop as soon as a single read request didn't fill it's buffer: if (nr != len) break; The generic_file_aio_read version doesn't. So if it hits EOF before the end of the list of buffers, it w

[PATCH 001 of 2] Fix read/truncate race.

2007-06-06 Thread NeilBrown
do_generic_mapping_read currently samples the i_size at the start and doesn't do so again unless it needs to call ->readpage to load a page. After ->readpage it has to re-sample i_size as a truncate may have caused that page to be filled with zeros, and the read() call should not see these. Howe

[PATCH 000 of 7] md: Introduction EXPLAIN PATCH SET HERE

2007-05-20 Thread NeilBrown
perly until now :-( The remainder are mainly cleaning up code and comments. They could wait for 2.6.23, but are probably safe to go into 2.6.22 (maybe sit a week in -mm??) Thanks, NeilBrown [PATCH 001 of 7] md: Avoid overflow in raid0 calculation with large components. [PATCH 002 of 7] md:

[PATCH 001 of 7] md: Avoid overflow in raid0 calculation with large components.

2007-05-20 Thread NeilBrown
If a raid0 has a component device larger than 4TB, and is accessed on a 32bit machines, then as 'chunk' is unsigned lock, chunk << chunksize_bits can overflow (this can be as high as the size of the device in KB). chunk itself will not overflow (without triggering a BUG). So change 'chunk' to

[PATCH 002 of 7] md: Don't write more than is required of the last page of a bitmap

2007-05-20 Thread NeilBrown
It is possible that real data or metadata follows the bitmap without full page alignment. So limit the last write to be only the required number of bytes, rounded up to the hard sector size of the device. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] ### Diffstat output ./

[PATCH 003 of 7] md: Fix bug with linear hot-add and elsewhere.

2007-05-20 Thread NeilBrown
Adding a drive to a linear array seems to have stopped working, due to changes elsewhere in md, and insufficient ongoing testing... So the patch to make linear hot-add work in the first place introduced a subtle bug elsewhere that interracts poorly with older version of mdadm. This fixes it all

[PATCH 004 of 7] md: Improve message about invalid superblock during autodetect.

2007-05-20 Thread NeilBrown
People try to use raid auto-detect with version-1 superblocks (which is not supported) and get confused when they are told they have an invalid superblock. So be more explicit, and say it it is not a valid v0.90 superblock. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./dri

[PATCH 005 of 7] md: Improve the is_mddev_idle test fix

2007-05-20 Thread NeilBrown
Don't use 'unsigned' variable to track sync vs non-sync IO, as the only thing we want to do with them is a signed comparison, and fix up the comment which had become quite wrong. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c | 35 +++

[PATCH 006 of 7] md: Check that internal bitmap does not overlap other data.

2007-05-20 Thread NeilBrown
We current completely trust user-space to set up metadata describing an consistant array. In particlar, that the metadata, data, and bitmap do not overlap. But userspace can be buggy, and it is better to report an error than corrupt data. So put in some appropriate checks. Signed-off-by: Neil B

[PATCH 007 of 7] md: Change bitmap_unplug and others to void functions.

2007-05-20 Thread NeilBrown
bitmap_unplug only ever returns 0, so it may as well be void. Two callers try to print a message if it returns non-zero, but that message is already printed by bitmap_file_kick. write_page returns an error which is not consistently checked. It always causes BITMAP_WRITE_ERROR to be set on an err

[PATCH 000 of 2] knfsd: Close oopsable race in nfsd

2007-04-16 Thread NeilBrown
(and so it not being cc:ed to [EMAIL PROTECTED]). Thanks, NeilBrown [PATCH 001 of 2] knfsd: Use a spinlock to protect sk_info_authunix [PATCH 002 of 2] knfsd: Rename sk_defer_lock to sk_lock - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

[PATCH 001 of 2] knfsd: Use a spinlock to protect sk_info_authunix

2007-04-16 Thread NeilBrown
sk_info_authunix is not being protected properly so the object that it points to can be cache_put twice, leading to corruption. We borrow svsk->sk_defer_lock to provide the protection. We should probably rename that lock to have a more generic name - later. Thanks to Gabriel for reporting this.

[PATCH 002 of 2] knfsd: Rename sk_defer_lock to sk_lock

2007-04-16 Thread NeilBrown
Now that sk_defer_lock protects two different things, make the name more generic. Also don't bother with disabling _bh as the lock is only ever taken from process context. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/sunrpc/svcsock.h |3 ++- ./net/sunrp

[PATCH 000 of 8] knfsd: Assorted bugfixes for 2.6.22

2007-05-06 Thread NeilBrown
less significant bug fixes and cleanups. Thanks, NeilBrown [PATCH 001 of 8] knfsd: Avoid use of unitialised variables on error path when nfs exports. [PATCH 002 of 8] knfsd: rpc: fix server-side wrapping of krb5i replies [PATCH 003 of 8] knfsd: Fix resource leak resulting in module refcount

[PATCH 001 of 8] knfsd: Avoid use of unitialised variables on error path when nfs exports.

2007-05-06 Thread NeilBrown
We need to zero various parts of 'exp' before any 'goto out', otherwise when we go to free the contents... we die. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] ### Diffstat output ./fs/nfsd/export.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) d

[PATCH 002 of 8] knfsd: rpc: fix server-side wrapping of krb5i replies

2007-05-06 Thread NeilBrown
It's not necessarily correct to assume that the xdr_buf used to hold the server's reply must have page data whenever it has tail data. And there's no need for us to deal with that case separately anyway. Acked-by: "J. Bruce Fields" <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]

[PATCH 004 of 8] knfsd: rpcgss : RPC_GSS_PROC_ DESTROY request will get a bad rpc

2007-05-06 Thread NeilBrown
From: Wei Yongjun <[EMAIL PROTECTED]> If I send a RPC_GSS_PROC_DESTROY message to NFSv4 server, it will reply with a bad rpc reply which lacks an authentication verifier. Maybe this patch is needed. Send/recv packets as following: send: RemoteProcedureCall xid rpcvers = 2 prog = 1

[PATCH 005 of 8] knfsd: Simplify a 'while' condition in svcsock.c

2007-05-06 Thread NeilBrown
This while loop has an overly complex condition, which performs a couple of assignments. This hurts readability. We don't really need a loop at all. We can just return -EAGAIN and (providing we set SK_DATA), the function will be called again. So discard the loop, make the complex conditional b

[PATCH 006 of 8] knfsd: Trivial makefile cleanup

2007-05-06 Thread NeilBrown
From: Christoph Hellwig <[EMAIL PROTECTED]> kbuild directly interprets -y as objects to build into a module, no need to assign it to the old foo-objs variable. Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./fs/nfsd/Make

[PATCH 007 of 8] knfsd: Various nfsd xdr cleanups.

2007-05-06 Thread NeilBrown
1/ decode_sattr and decode_sattr3 never return NULL, so remove several checks for that. ditto for xdr_decode_hyper. 2/ replace some open coded XDR_QUADLEN calls with calls to XDR_QUADLEN 3/ in decode_writeargs, simply an 'if' to use a single calculation. .page_len is the length of that

[PATCH 008 of 8] knfsd: Avoid Oops if buggy userspace performs confusing filehandle->dentry mapping.

2007-05-06 Thread NeilBrown
When a lookup request arrives, nfsd uses information provided by userspace (mountd) to find the right filesystem. It then assumes that the same filehandle type as the incoming filehandle can be used to create an outgoing filehandle. However if mountd is buggy, or maybe just being creative, the fil

[PATCH 003 of 8] knfsd: Fix resource leak resulting in module refcount leak for rpcsec_gss_krb5.ko

2007-05-06 Thread NeilBrown
From: Frank Filz <[EMAIL PROTECTED]> I have been investigating a module reference count leak on the server for rpcsec_gss_krb5.ko. It turns out the problem is a reference count leak for the security context in net/sunrpc/auth_gss/svcauth_gss.c. The problem is that gss_write_init_verf() calls gss

[PATCH 000 of 5] md: assorted bug fixes and minor features

2007-05-07 Thread NeilBrown
Following are 5 patches for md suitable for 2.6.22. None are needed for -stable. Thanks NeilBrown [PATCH 001 of 5] md: Move test for whether level supports bitmap to correct place. [PATCH 002 of 5] md: Stop using csum_partial for checksum calculation in md. [PATCH 003 of 5] md: Remove the

[PATCH 001 of 5] md: Move test for whether level supports bitmap to correct place.

2007-05-07 Thread NeilBrown
We need to check for internal-consistency of superblock in load_super. validate_super is for inter-device consistency. With the test in the wrong place, a badly created array will confuse md rather an produce sensible errors. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output .

[PATCH 002 of 5] md: Stop using csum_partial for checksum calculation in md.

2007-05-07 Thread NeilBrown
If CONFIG_NET is not selected, csum_partial is not exported, so md.ko cannot use it. We shouldn't really be using csum_partial anyway as it is an internal-to-networking interface. So replace it with C code to do the same thing. Speed is not crucial here, so something simple and correct is best.

[PATCH 003 of 5] md: Remove the slash from the name of a kmem_cache used by raid5.

2007-05-07 Thread NeilBrown
SLUB doesn't like slashes as it wants to use the cache name as the name of a directory (or symlink) in sysfs. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff .prev/drivers/md/raid5.c ./driv

[PATCH 004 of 5] md: Allow reshape_position for md arrays to be set via sysfs.

2007-05-07 Thread NeilBrown
"reshape_position" records how much progress has been made on a "reshape" (adding drives, changing layout or chunksize). When it is set, the number of drives, layout and chunksize can have two possible values, an old an a new. So allow these different values to be visible, and allow both old and

[PATCH 005 of 5] md: Improve partition detection in md array.

2007-05-07 Thread NeilBrown
md currently uses ->media_changed to make sure rescan_partitions is call on md array after they are assembled. However that doesn't happen until the array is opened, which is later than some people would like. So use blkdev_ioctl to do the rescan immediately that the array has been assembled. T

[PATCH 000 of 2] md: Two more bugfixes.

2007-05-09 Thread NeilBrown
Following are two bugfixes for md in current kernels. The first is suitable for -stable is it can allow drive errors through to the filesystem wrongly. Both are suitable for 2.6.22. Thanks, NeilBrown [PATCH 001 of 2] md: Avoid a possibility that a read error can wrongly propagate through md

[PATCH 001 of 2] md: Avoid a possibility that a read error can wrongly propagate through md/raid1 to a filesystem.

2007-05-09 Thread NeilBrown
When a raid1 has only one working drive, we want read error to propagate up to the filesystem as there is no point failing the last drive in an array. Currently the code perform this check is racy. If a write and a read a both submitted to a device on a 2-drive raid1, and the write fails followe

[PATCH 002 of 2] md: Improve the is_mddev_idle test

2007-05-09 Thread NeilBrown
During a 'resync' or similar activity, md checks if the devices in the array are otherwise active and winds back resync activity when they are. This test in done in is_mddev_idle, and it is somewhat fragile - it sometimes thinks there is non-sync io when there isn't. The test compares the total

[PATCH 000 of 4] knfsd: 4 bugfixes for nfsd suitable for 2.6.21

2007-03-22 Thread NeilBrown
Following are 4 small bugfixes for nfsd that are suitable for 2.6.21. Thanks, NeilBrown [PATCH 001 of 4] knfsd: Allow nfsd READDIR to return 64bit cookies [PATCH 002 of 4] knfsd: nfsd4: fix inheritance flags on v4 ace derived from posix default ace [PATCH 003 of 4] knfsd: nfsd4: demote

[PATCH 001 of 4] knfsd: Allow nfsd READDIR to return 64bit cookies

2007-03-22 Thread NeilBrown
->readdir passes lofft_t offsets (used as nfs cookies) to nfs3svc_encode_entry{,_plus}, but when they pass it on to encode_entry it becomes an 'off_t', which isn't good. So filesystems that returned 64bit offsets would lose. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./

[PATCH 004 of 4] knfsd: nfsd4: remove superfluous cancel_delayed_work() call

2007-03-22 Thread NeilBrown
From: "J. Bruce Fields" <[EMAIL PROTECTED]> This cancel_delayed_work call is called from a function that is only called from a piece of code that immediate follows a cancel and destruction of the workqueue, so it's clearly a mistake. Cc: Oleg Nesterov <[EMAIL PROTECTED]> Signed-off-by: "J. Bruce

[PATCH 002 of 4] knfsd: nfsd4: fix inheritance flags on v4 ace derived from posix default ace

2007-03-22 Thread NeilBrown
From: Bruce Fields <[EMAIL PROTECTED]> A regression introduced in the last set of acl patches removed the INHERIT_ONLY flag from aces derived from the posix acl. Fix. Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./fs/nf

[PATCH 003 of 4] knfsd: nfsd4: demote "clientid in use" printk to a dprintk

2007-03-22 Thread NeilBrown
From: Bruce Fields <[EMAIL PROTECTED]> The reused clientid here is a more of a problem for the client than the server, and the client can report the problem itself if it's serious. Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat ou

[PATCH 000 of 3] md: bug fixes for md for 2.6.21

2007-03-22 Thread NeilBrown
A minor new feature and 2 bug fixes for md suitable for 2.6.21 The minor feature is to make reshape (adding a drive to an array and restriping it) work for raid4. The code is all ready, it just wasn't used. Thanks, NeilBrown [PATCH 001 of 3] md: Allow raid4 arrays to be reshaped. [PATC

[PATCH 001 of 3] md: Allow raid4 arrays to be reshaped.

2007-03-22 Thread NeilBrown
All that is missing the the function pointers in raid4_pers. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c |4 1 file changed, 4 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c --- .prev/drivers/md/raid5.c2007-03-23 11:13:

[PATCH 002 of 3] md: Clear the congested_fn when stopping a raid5

2007-03-22 Thread NeilBrown
If this mddev and queue got reused for another array that doesn't register a congested_fn, this function would get called incorretly. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c|1 + ./drivers/md/raid5.c |3 ++- 2 files changed, 3 insertions(+

[PATCH 003 of 3] md: Convert compile time warnings into runtime warnings.

2007-03-22 Thread NeilBrown
... still not sure why we need this Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c| 41 +++-- ./drivers/md/raid5.c | 12 ++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff .prev/drivers/md/m

[PATCH] md: Fix for raid6 reshape.

2007-03-01 Thread NeilBrown
### Comments for Changeset Recent patch for raid6 reshape had a change missing that showed up in subsequent review. Many places in the raid5 code used "conf->raid_disks-1" to mean "number of data disks". With raid6 that had to be changed to "conf->raid_disk - conf->max_degraded" or similar. One

[PATCH 000 of 3] knfsd: Resolve IPv6 related link error

2007-03-01 Thread NeilBrown
small optimisation. Finally the last patch removes all the #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) from sunrpc as it really isn't needed and just hides this sort of problem. Patches 1 and 3 are suitable for 2.6.21. Patch 2 needs confirmation. Thanks, NeilBrown [PATC

[PATCH 001 of 3] knfsd: Use recv_msg to get peer address for NFSD instead of code-copying

2007-03-01 Thread NeilBrown
The sunrpc server code needs to know the source and destination address for UDP packets so it can reply properly. It currently copies code out of the network stack to pick the pieces out of the skb. This is ugly and causes compile problems with the IPv6 stuff. So, rip that out and use recv_msg i

[PATCH 002 of 3] knfsd: Avoid checksum checks when collecting metadata for a UDP packet.

2007-03-01 Thread NeilBrown
When recv_msg is called with a size of 0 and MSG_PEEK (and sunrpc/svcsock.c does), it is clear that we only interested in metadata (from/to addresses) and not the data, so don't do any checksum checking at this point. Leave that until the data is requested. Signed-off-by: Neil Brown <[EMAIL PROT

[PATCH 003 of 3] knfsd: Remove CONFIG_IPV6 ifdefs from sunrpc server code.

2007-03-01 Thread NeilBrown
They don't really save that much, and aren't worth the hassle. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/sunrpc/svc.h |2 -- ./net/sunrpc/svcsock.c | 13 +++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff .prev/include/linux

[PATCH 000 of 4] knfsd: revised patches to fix IPv6/sunrpc link error and other fixes

2007-03-05 Thread NeilBrown
chines, and often needs tuning where it can be optimal. Thanks, NeilBrown [PATCH 001 of 4] knfsd: Use recv_msg to get peer address for NFSD instead of code-copying [PATCH 002 of 4] knfsd: Remove CONFIG_IPV6 ifdefs from sunrpc server code. [PATCH 003 of 4] knfsd: Fix recently introduced problem

[PATCH 001 of 4] knfsd: Use recv_msg to get peer address for NFSD instead of code-copying

2007-03-05 Thread NeilBrown
The sunrpc server code needs to know the source and destination address for UDP packets so it can reply properly. It currently copies code out of the network stack to pick the pieces out of the skb. This is ugly and causes compile problems with the IPv6 stuff. So, rip that out and use recv_msg i

[PATCH 004 of 4] knfsd: Provide sunrpc pool_mode module option

2007-03-05 Thread NeilBrown
From: Greg Banks <[EMAIL PROTECTED]> Provide a module param "pool_mode" for sunrpc.ko which allows a sysadmin to choose the mode for mapping NFS thread service pools to CPUs. Values are: autochoose a mapping mode heuristically global (default, same as the pre-2.6.19 code) a single

[PATCH 003 of 4] knfsd: Fix recently introduced problem with shutting down a busy NFS server.

2007-03-05 Thread NeilBrown
When the last thread of nfsd exits, it shuts down all related sockets. It currently uses svc_close_socket to do this, but that only is immediately effective if the socket is not SK_BUSY. If the socket is busy - i.e. if a request has arrived that has not yet been processes - svc_close_socket is no

[PATCH 002 of 4] knfsd: Remove CONFIG_IPV6 ifdefs from sunrpc server code.

2007-03-05 Thread NeilBrown
They don't really save that much, and aren't worth the hassle. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/sunrpc/svc.h |2 -- ./net/sunrpc/svcsock.c | 13 +++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff .prev/include/linux

[PATCH] md: Avoid a deadlock when removing a device from an md array via sysfs.

2007-04-02 Thread NeilBrown
(This patch should go in 2.6.21 as it fixes a recent regression - NB) A device can be removed from an md array via e.g. echo remove > /sys/block/md3/md/dev-sde/state This will try to remove the 'dev-sde' subtree which will deadlock since commit e7b0d26a86943370c04d6833c6edba2a72a6e240 With t

Re: [RFC PATCH 1/2] mempool: do not consume memory reserves from the reclaim path

2016-07-21 Thread NeilBrown
> - /* If oom killed, memory reserves are essential to prevent livelock */ > - VM_WARN_ON_ONCE(gfp_mask & __GFP_NOMEMALLOC); > - /* No element size to zero on allocation */ > VM_WARN_ON_ONCE(gfp_mask & __GFP_ZERO); > - > might_sleep_if(gfp_mask & __GFP_DIRECT_RECLAIM); > > + gfp_mask |= __GFP_NOMEMALLOC; /* don't allocate emergency reserves */ > gfp_mask |= __GFP_NORETRY; /* don't loop in __alloc_pages */ > gfp_mask |= __GFP_NOWARN; /* failures are OK */ As I was reading through this thread I kept thinking "Surely mempool_alloc() should never ever allocate from emergency reserves. Ever." Then I saw this patch. It made me happy. Thanks. Acked-by: NeilBrown (if you want it) NeilBrown signature.asc Description: PGP signature

Re: [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-22 Thread NeilBrown
pted version in the page cache. But if dm-crypt is just allocating a transient page (which I think it is), then a mempool should be sufficient (and we should make sure it is sufficient) and access to an extra 10% (or whatever) of the page cache isn't justified. Thanks, NeilBrown If there

Re: [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-22 Thread NeilBrown
On Fri, Jul 22 2016, NeilBrown wrote: > > Looking at the current code, __GFP_DIRECT_RECLAIM is disabled the first > time through, but if the pool is empty, direct-reclaim is allowed on the > next attempt. Presumably this is where the throttling comes in ?? I > suspect that it r

Re: [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-22 Thread NeilBrown
ould a PF_MEMPOOL be any better? Why a PF rather than a GFP flag? NFSD uses a PF because there is no GFP interface for filesystem write. But mempool can pass down a GFP flag, so I think it should. The meaning of the flag is, in my opinion, that a 'transient' allocation is being requested

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-27 Thread NeilBrown
On Thu, Jul 28 2016, Michal Hocko wrote: > On Wed 27-07-16 13:43:35, NeilBrown wrote: >> On Mon, Jul 25 2016, Michal Hocko wrote: >> >> > On Sat 23-07-16 10:12:24, NeilBrown wrote: > [...] >> So should there be a limit on dirty >> pages in the swap cache ju

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-27 Thread NeilBrown
On Thu, Jul 28 2016, Mikulas Patocka wrote: > On Wed, 27 Jul 2016, NeilBrown wrote: > >> On Tue, Jul 26 2016, Mikulas Patocka wrote: >> >> > On Sat, 23 Jul 2016, NeilBrown wrote: >> > >> >> "dirtying ... from the reclaim context"

Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-09-08 Thread NeilBrown
On Thu, Sep 08 2016, Baolin Wang wrote: > Hi Neil, > > On 6 September 2016 at 13:40, NeilBrown wrote: >> On Mon, Aug 29 2016, Baolin Wang wrote: >> >>> Hi Felipe, >>> >>> On 11 August 2016 at 11:14, Baolin Wang wrote: >>>> Hi Fel

Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-09-08 Thread NeilBrown
On Thu, Sep 08 2016, Baolin Wang wrote: > On 8 September 2016 at 15:31, NeilBrown wrote: >> On Thu, Sep 08 2016, Baolin Wang wrote: >>> >>> Now the usb charger will not get charger type from 'extcon' subsystem, >>> we get the charger type from 

Re: [PATCH] autofs - use dentry flags to block walks during expire

2016-09-08 Thread NeilBrown
/* > + * Possibly being selected for expire, wait until > + * it's selected or not. > + */ > + schedule_timeout(HZ/10); Hi Ian, I think you want schedule_timeout_uninterruptible(HZ/10) here. schedule_timeout() only causes a delay if the task state has been changed from runnable. There is a similar bug in fscache_object_sleep_till_congested(). Nothing changes the task state from TASK_RUNNING in that function before it calls schedule_timeout(*timeoutp); Also should this patch be marked as Fixes: 47be61845c77 ("fs/dcache.c: avoid soft-lockup in dput()") so it follows that patch in -stable backport? Thanks, NeilBrown signature.asc Description: PGP signature

Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-09-13 Thread NeilBrown
On Mon, Sep 12 2016, Mark Brown wrote: > [ Unknown signature status ] > On Mon, Sep 12, 2016 at 03:27:18PM +0200, NeilBrown wrote: >> On Mon, Sep 12 2016, Mark Brown wrote: > >> > It's no worse than any other board file situation - if someone has that >> &g

Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-09-14 Thread NeilBrown
On Wed, Sep 14 2016, Mark Brown wrote: > [ Unknown signature status ] > On Tue, Sep 13, 2016 at 10:00:28AM +0200, NeilBrown wrote: >> On Mon, Sep 12 2016, Mark Brown wrote: > >> > That's not actually 100% clear to me - for what the wm831x is doing it >> >

Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-09-14 Thread NeilBrown
o ensure that voltage doesn't drop unduly, then I agree with your assertion that it just needs to be told the upper limit. I hope you'll agree that other drivers might need to know the lower limit, so reporting both to all drivers is sensible. Thanks, NeilBrown signature.asc Description: PGP signature

Re: Do we really need d_weak_revalidate???

2017-08-15 Thread NeilBrown
On Mon, Aug 14 2017, Jeff Layton wrote: > On Mon, 2017-08-14 at 09:36 +1000, NeilBrown wrote: >> On Fri, Aug 11 2017, Jeff Layton wrote: >> >> > On Fri, 2017-08-11 at 05:55 +, Trond Myklebust wrote: >> > > On Fri, 2017-08-11 at 14:31 +1000, NeilBrown wro

Re: Do we really need d_weak_revalidate???

2017-08-16 Thread NeilBrown
On Wed, Aug 16 2017, Jeff Layton wrote: > On Wed, 2017-08-16 at 12:43 +1000, NeilBrown wrote: >> On Mon, Aug 14 2017, Jeff Layton wrote: >> >> > On Mon, 2017-08-14 at 09:36 +1000, NeilBrown wrote: >> > > On Fri, Aug 11 2017, Jeff Layton wrote: >> >

Re: Do we really need d_weak_revalidate???

2017-08-17 Thread NeilBrown
On Thu, Aug 17 2017, Ian Kent wrote: > On 16/08/17 19:34, Jeff Layton wrote: >> On Wed, 2017-08-16 at 12:43 +1000, NeilBrown wrote: >>> On Mon, Aug 14 2017, Jeff Layton wrote: >>> >>>> On Mon, 2017-08-14 at 09:36 +1000, NeilBrown wrote: >&

[PATCH] autofs: don't fail mount for transient error

2017-11-02 Thread NeilBrown
mountpoint. Signed-off-by: NeilBrown --- Do people think this should got to -stable ?? It isn't a crash or a data corruption, but having autofs mountpoints suddenly stop working is rather inconvenient. Thanks, NeilBrown fs/autofs4/waitq.c | 15 ++- 1 file changed, 14 insertions(

Re: [lustre-devel] [PATCH 0/6] dcache/namei fixes for lustre

2017-10-24 Thread NeilBrown
l be pushing to > the next staging tree very shortly. ll_d_init() doesn't need to be called from anywhere. It is called by __d_alloc (dentry->d_op->d_init) whenever a dentry is allocated. That is all that is needed. > > I have been testing the patch series and for me

Re: [PATCH 0/9] Assorted cleanups for staging/.../lustre/ldlm/ldlm_flock.c

2017-10-25 Thread NeilBrown
esent, including these and the namei/dcache patches). Is posting them here the best approach? I assume I should keep them in well-defined groups. Should I wait for one set to be merged before sending more, or should I just send them when I think they are ready and you (or others) will look at

[PATCH] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2017-10-25 Thread NeilBrown
synchronize_rcu_expedited() the umount time on a 4-cpu VM is 8 seconds to mount and 0.6 to unmount. I think this 200-fold speed up is worth the slightly higher system impact of use synchronize_rcu_expedited(). Signed-off-by: NeilBrown --- Cc: to Paul and Josh in case they'll correct me if

Re: [PATCH] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2017-10-26 Thread NeilBrown
On Thu, Oct 26 2017, Paul E. McKenney wrote: > On Thu, Oct 26, 2017 at 01:26:37PM +1100, NeilBrown wrote: >> >> The synchronize_rcu() in namespace_unlock() is called every time >> a filesystem is unmounted. If a great many filesystems are mounted, >> this can cause a

Re: [lustre-devel] [PATCH 0/6] dcache/namei fixes for lustre

2017-10-19 Thread NeilBrown
t some cycles we will > figure out what is going on. Thanks for helping out. Hi, what happened about this? I had a look around the ticket and couldn't find anything about an oops. If there is still a problem I'd be very happy to help work out what it is - but I don't know where to look. Thanks, NeilBrown signature.asc Description: PGP signature

Re: [VFS PATCH] constify more dcache.h inlined helpers.

2017-10-19 Thread NeilBrown
On Wed, Aug 02 2017, NeilBrown wrote: > Many of the inlines in dcache.h were changed to accept > const struct pointers in commit f0d3b3ded999 ("constify dcache.c > inlined helpers where possible"). > This patch allows 'const' in a couple that were added since th

Re: [lustre-devel] [PATCH 9/9] staging: lustre: ldlm: remove unused field 'fwd_generation'

2017-10-27 Thread NeilBrown
On Fri, Oct 27 2017, Dilger, Andreas wrote: > On Oct 22, 2017, at 18:53, NeilBrown wrote: >> >> With this field gone, we don't need local variables 'imp' or 'obd' >> any more. >> >> Signed-off-by: NeilBrown > > Thanks for the pat

[PATCH 00/10] staging: lustre: assorted code improvements for list manipulations.

2017-10-29 Thread NeilBrown
There are mostly conversions of list_for_each() to list_for_each_entry() and similar. list_first_entry() also makes a few appearances. Thanks, NeilBrown --- NeilBrown (10): staging: lustre: use list_last_entry to simplify fld_cache_shrink staging: lustre: ldlm: use

[PATCH 02/10] staging: lustre: ldlm: use list_for_each_entry in ldlm_extent_shift_kms()

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 2cc6dc2b281f..c9bf9ae40f7d 100644

[PATCH 01/10] staging: lustre: use list_last_entry to simplify fld_cache_shrink

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/fld/fld_cache.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index b723ece02eff..c01709cd22a1 100644

[PATCH 03/10] staging: lustre: ldlm: use list_first_entry in ldlm_lock

2017-10-29 Thread NeilBrown
This make the code (slightly) more readable. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm

[PATCH 05/10] staging: lustre: ldlm: use list_first_entry in ldlm_lockd.c

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index e2707336586c..2aaa5e91c66c 100644

[PATCH 06/10] staging: lustre: ldlm: minor list_entry improvements in ldlm_request.c

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index f5e791a92f62

[PATCH 07/10] staging: lustre: ldlm: use list_for_each_entry in ldlm_resource.c

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index c2ddf7312571

[PATCH 04/10] staging: lustre: ldlm: use list_for_each_entry in ldlm_lock.c

2017-10-29 Thread NeilBrown
This makes some slightly-confusing code a bit clearer, and avoids the need for 'tmp'. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm

[PATCH 09/10] staging: lustre: simplfy lov_finish_set()

2017-10-29 Thread NeilBrown
When deleting everything from a list, a while loop is cleaner than list_for_each_safe(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/lov/lov_request.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c

[PATCH 08/10] staging: lustre: lov: use list_for_each_entry in lov_obd.c

2017-10-29 Thread NeilBrown
Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/lov/lov_obd.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index fefd3c588681..7e013229d7b5 100644 --- a/drivers

[PATCH 10/10] staging: lustre: obdclass: simplify cl_lock_fini()

2017-10-29 Thread NeilBrown
Using list_first_entry_or_null() makes this (slightly) simpler. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/cl_lock.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging

[PATCH] NFS: Use an appropriate work queue for direct-write completion

2018-08-07 Thread NeilBrown
When a direct-write completes, a work_struct is schedule to handle the completion. When NFS is being used for swap, the direct write might be a swap-out, so memory allocation can block until the write completes. The work queue currently used is not WQ_MEM_RECLAIM, so tasks can block waiting for me

[PATCH 0/4] locks: avoid thundering-herd wake-ups

2018-08-07 Thread NeilBrown
with this patch. For 100 processes, this patch still provides 1.4 million while without this patch there are about 700,000. NeilBrown --- NeilBrown (4): fs/locks: rename some lists and pointers. fs/locks: allow a lock request to block other requests. fs/locks: change all

[PATCH 4/4] fs/locks: create a tree of dependent requests.

2018-08-07 Thread NeilBrown
. The rest of the herd can stay asleep. Reported-and-tested-by: Martin Wilck Signed-off-by: NeilBrown --- fs/locks.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index aaa55925c788..69a30421218b 100644 --- a/fs

<    1   2   3   4   5   6   7   8   9   10   >