summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* nfsd: make unconf_id_hashtbl allocated per netStanislav Kinsbursky2012-11-152-10/+16
| | | | | | | | | | | | This hash holds nfs4_clients info, which are network namespace aware. So let's make it allocated per network namespace. Note: this hash can be allocated in per-net operations. But it looks better to allocate it on nfsd state start and thus don't waste resources if server is not running. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: make conf_name_tree per netStanislav Kinsbursky2012-11-152-15/+20
| | | | | | | | This tree holds nfs4_clients info, which are network namespace aware. So let's make it per network namespace. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: make conf_id_hashtbl allocated per netStanislav Kinsbursky2012-11-152-21/+55
| | | | | | | | | | | | This hash holds nfs4_clients info, which are network namespace aware. So let's make it allocated per network namespace. Note: this hash can be allocated in per-net operations. But it looks better to allocate it on nfsd state start and thus don't waste resources if server is not running. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: make reclaim_str_hashtbl allocated per netStanislav Kinsbursky2012-11-154-55/+111
| | | | | | | | | | | This hash holds nfs4_clients info, which are network namespace aware. So let's make it allocated per network namespace. Note: this hash is used only by legacy tracker. So let's allocate hash in tracker init. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: make nfs4_client network namespace dependentStanislav Kinsbursky2012-11-154-13/+14
| | | | | | | And use it's net where possible. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: use service net instead of hard-coded net where possibleStanislav Kinsbursky2012-11-151-5/+5
| | | | | Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* svcrpc: Revert "sunrpc/cache.h: replace simple_strtoul"J. Bruce Fields2012-11-151-1/+5
| | | | | | | | | | | | | | | | | Commit bbf43dc888833ac0539e437dbaeb28bfd4fbab9f "sunrpc/cache.h: replace simple_strtoul" introduced new range-checking which could cause get_int to fail on unsigned integers too large to be represented as an int. We could parse them as unsigned instead--but it turns out svcgssd is actually passing down "-1" in some cases. Which is perhaps stupid, but there's nothing we can do about it now. So just revert back to the previous "sloppy" behavior that accepts either representation. Cc: stable@vger.kernel.org Reported-by: Sven Geggus <lists@fuchsschwanzdomain.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: get_backchannel_cred should be staticFengguang Wu2012-11-141-1/+1
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: init_session should be declared staticFengguang Wu2012-11-141-1/+1
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: release the legacy reclaimable clients list in grace_doneJeff Layton2012-11-121-0/+1
| | | | | | | | | The current code holds on to this list until nfsd is shut down, but it's never touched once the grace period ends. Release that memory back into the wild when the grace period ends. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: get rid of cl_recdir fieldJeff Layton2012-11-123-36/+77
| | | | | | | | | | | | | Remove the cl_recdir field from the nfs4_client struct. Instead, just compute it on the fly when and if it's needed, which is now only when the legacy client tracking code is in effect. The error handling in the legacy client tracker is also changed to handle the case where md5 is unavailable. In that case, we'll warn the admin with a KERN_ERR message and disable the client tracking. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: move the confirmed and unconfirmed hlists to a rbtreeJeff Layton2012-11-122-52/+95
| | | | | | | | | | | | The current code requires that we md5 hash the name in order to store the client in the confirmed and unconfirmed trees. Change it instead to store the clients in a pair of rbtrees, and simply compare the cl_names directly instead of hashing them. This also necessitates that we add a new flag to the clp->cl_flags field to indicate which tree the client is currently in. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: don't search for client by hash on legacy reboot recovery gracedoneJeff Layton2012-11-123-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When nfsd starts, the legacy reboot recovery code creates a tracking struct for each directory in the v4recoverydir. When the grace period ends, it basically does a "readdir" on the directory again, and matches each dentry in there to an existing client id to see if it should be removed or not. If the matching client doesn't exist, or hasn't reclaimed its state then it will remove that dentry. This is pretty inefficient since it involves doing a lot of hash-bucket searching. It also means that we have to keep relying on being able to search for a nfs4_client by md5 hashed cl_recdir name. Instead, add a pointer to the nfs4_client that indicates the association between the nfs4_client_reclaim and nfs4_client. When a reclaim operation comes in, we set the pointer to make that association. On gracedone, the legacy client tracker will keep the recdir around iff: 1/ there is a reclaim record for the directory ...and... 2/ there's an association between the reclaim record and a client record -- that is, a create or check operation was performed on the client that matches that directory. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: make nfs4_client_to_reclaim return a pointer to the reclaim recordJeff Layton2012-11-122-11/+11
| | | | | | | Later callers will need to make changes to the record. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: break out reclaim record removal into separate functionJeff Layton2012-11-122-3/+10
| | | | | | | We'll need to be able to call this from nfs4recover.c eventually. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: have nfsd4_find_reclaim_client take a char * argumentJeff Layton2012-11-123-9/+6
| | | | | | | | | Currently, it takes a client pointer, but later we're going to need to search for these records without knowing whether a matching client even exists. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: warn about impending removal of nfsdcld upcallJeff Layton2012-11-121-0/+3
| | | | | | | | | Let's shoot for removing the nfsdcld upcall in 3.10. Most likely, no one is actually using it so I don't expect this warning to fire often (except maybe on misconfigured systems). Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: pass info about the legacy recoverydir in environment variablesJeff Layton2012-11-121-8/+82
| | | | | | | | | | | | | | | | | | The usermodehelper upcall program can then decide to use this info as a (one-way) transition mechanism to the new scheme. When a "check" upcall occurs and the client doesn't exist in the database, we can look to see whether the directory exists. If it does, then we'd add the client to the database, remove the legacy recdir, and return success to the kernel to allow the recovery to proceed. For gracedone, we simply pass the v4recovery "topdir" so that the upcall can clean it out prior to returning to the kernel. A module parm is also added to disable the legacy conversion if the admin chooses. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: change heuristic for selecting the client_tracking_opsJeff Layton2012-11-121-9/+27
| | | | | | | | | | | First, try to use the new usermodehelper upcall. It should succeed or fail quickly, so there's little cost to doing so. If it fails, and the legacy tracking dir exists, use that. If it doesn't exist then fall back to using nfsdcld. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: add a usermodehelper upcall for NFSv4 client ID trackingJeff Layton2012-11-121-1/+133
| | | | | | | | | | | | | | | Add a new client tracker upcall type that uses call_usermodehelper to call out to a program. This seems to be the preferred method of calling out to usermode these days for seldom-called upcalls. It's simple and doesn't require a running daemon, so it should "just work" as long as the binary is installed. The client tracking exit operation is also changed to check for a NULL pointer before running. The UMH upcall doesn't need to do anything at module teardown time. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: remove unused argument to nfs4_has_reclaimed_stateJeff Layton2012-11-103-3/+3
| | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: fix error handling in nfsd4_remove_clid_dirJeff Layton2012-11-101-1/+2
| | | | | | | | If the credential save fails, then we'll leak our mnt_want_write_file reference. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: update documentation on 4.1 progressJ. Bruce Fields2012-11-101-8/+1
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: backchannel should use client-provided security flavorJ. Bruce Fields2012-11-073-5/+13
| | | | | | | For now this only adds support for AUTH_NULL. (Previously we assumed AUTH_UNIX.) We'll also need AUTH_GSS, which is trickier. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: common helper to initialize callback workJ. Bruce Fields2012-11-073-4/+9
| | | | | | | I've found it confusing having the only references to nfsd4_do_callback_rpc() in a different file. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: implement backchannel_ctl operationJ. Bruce Fields2012-11-076-7/+40
| | | | | | This operation is mandatory for servers to implement. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: use callback security parameters in create_sessionJ. Bruce Fields2012-11-073-14/+37
| | | | | | | | | | | | | | | | We're currently ignoring the callback security parameters specified in create_session, and just assuming the client wants auth_sys, because that's all the current linux client happens to care about. But this could cause us callbacks to fail to a client that wanted something different. For now, all we're doing is no longer ignoring the uid and gid passed in the auth_sys case. Further patches will add support for auth_null and gss (and possibly use more of the auth_sys information; the spec wants us to use exactly the credential we're passed, though it's hard to imagine why a client would care). Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: clean up callback security parsingJ. Bruce Fields2012-11-072-57/+70
| | | | | | Move the callback parsing into a separate function. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: use vfs_fsync_range(), not O_SYNC, for stable writesJ. Bruce Fields2012-11-071-7/+6
| | | | | | | | | | | | | NFSv4 shares the same struct file across multiple writes. (And we'd like NFSv2 and NFSv3 to do that as well some day.) So setting O_SYNC on the struct file as a way to request a synchronous write doesn't work. Instead, do a vfs_fsync_range() in that case. Reported-by: Peter Staubach <pstaubach@exagrid.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: assume writeable exportabled filesystems have f_syncJ. Bruce Fields2012-11-071-13/+0
| | | | | | | | | | | | | | | | I don't really see how you could claim to support nfsd and not support fsync somehow. And in practice a quick look through the exportable filesystems suggests the only ones without an ->fsync are read-only (efs, isofs, squashfs) or in-memory (shmem). Also, performing a write and then returning an error if the sync fails (as we would do here in the wgather case) seems unhelpful to clients. Also remove an incorrect comment. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: don't BUG in delegation break callbackJ. Bruce Fields2012-11-071-3/+8
| | | | | | | | These conditions would indeed indicate bugs in the code, but if we want to hear about them we're likely better off warning and returning than immediately dying while holding file_lock_lock. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* svcrpc: demote some printks to a dprintkJ. Bruce Fields2012-11-071-3/+2
| | | | | | | In general I'd rather random bad behavior on the network won't trigger a printk. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: remove unused init_session returnJ. Bruce Fields2012-11-071-2/+1
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: helper function for getting mounted_on inoJ. Bruce Fields2012-11-071-12/+18
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfs: fix wrong object type in lockowner_slabYanchuan Nian2012-11-071-1/+1
| | | | | | | | | The object type in the cache of lockowner_slab is wrong, and it is better to fix it. Cc: stable@vger.kernel.org Signed-off-by: Yanchuan Nian <ycnian@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd4: remove unused variable in nfsd4_delegreturn()Wei Yongjun2012-11-071-2/+0
| | | | | | | | | | | The variable inode is initialized but never used otherwise, so remove the unused variable. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* exportfs: add FILEID_INVALID to indicate invalid fid_typeNamjae Jeon2012-11-074-5/+10
| | | | | | | | | | | This commit adds FILEID_INVALID = 0xff in fid_type to indicate invalid fid_type It avoids using magic number 255 Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Vivek Trivedi <vtrivedi018@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* Linux 3.7-rc2v3.7-rc2Linus Torvalds2012-10-201-1/+1
|
* Merge tag 'arm64-fixes' of ↵Linus Torvalds2012-10-209-45/+83
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 Pull arm64 fixes from Catalin Marinas: "Main changes: - AArch64 Linux compilation fixes following 3.7-rc1 changes (MODULES_USE_ELF_RELA, update_vsyscall() prototype) - Unnecessary register setting in start_thread() (thanks to Al Viro) - ptrace fixes" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: arm64: fix alignment padding in assembly code arm64: ptrace: use HW_BREAKPOINT_EMPTY type for disabled breakpoints arm64: ptrace: make structure padding explicit for debug registers arm64: No need to set the x0-x2 registers in start_thread() arm64: Ignore memory blocks below PHYS_OFFSET arm64: Fix the update_vsyscall() prototype arm64: Select MODULES_USE_ELF_RELA arm64: Remove duplicate inclusion of mmu_context.h in smp.c
| * arm64: fix alignment padding in assembly codeMarc Zyngier2012-10-202-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An interesting effect of using the generic version of linkage.h is that the padding is defined in terms of x86 NOPs, which can have even more interesting effects when the assembly code looks like this: ENTRY(func1) mov x0, xzr ENDPROC(func1) // fall through ENTRY(func2) mov x0, #1 ret ENDPROC(func2) Admittedly, the code is not very nice. But having code from another architecture doesn't look completely sane either. The fix is to add arm64's version of linkage.h, which causes the insertion of proper AArch64 NOPs. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
| * arm64: ptrace: use HW_BREAKPOINT_EMPTY type for disabled breakpointsWill Deacon2012-10-181-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a debugger tries to zero a hardware debug control register, the kernel will try to infer both the type and length of the breakpoint in order to sanity-check against the requested regset type. This will fail because the encoding will appear as a zero-length breakpoint. This patch changes the control register setting so that disabled breakpoints are treated as HW_BREAKPOINT_EMPTY and no further sanity-checking is required. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
| * arm64: ptrace: make structure padding explicit for debug registersWill Deacon2012-10-182-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | The user_hwdebug_state structure contains implicit padding to conform to the alignment requirements of the AArch64 ABI (namely that aggregates must be aligned to their most aligned member). This patch fixes the ptrace functions operating on struct user_hwdebug_state so that the padding is handled correctly. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
| * arm64: No need to set the x0-x2 registers in start_thread()Catalin Marinas2012-10-181-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For historical reasons, ARM used to set r0-r2 in start_thread() to the first values on the user stack when starting a new user application. The same logic has been inherited in AArch64. The x0 register is overridden by the sys_execve() return value so it's always zero on success. The x1 and x2 registers are ignored by AArch64 and EABI AArch32 applications, so we can safely remove the register setting for both native and compat user space. This also fixes a potential fault with the kernel accessing user space stack directly. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Reported-by: Al Viro <viro@zeniv.linux.org.uk>
| * arm64: Ignore memory blocks below PHYS_OFFSETCatalin Marinas2012-10-181-0/+12
| | | | | | | | | | | | | | | | | | | | According to Documentation/arm64/booting.txt, the kernel image must be loaded at a pre-defined offset from the start of RAM so that the kernel can calculate PHYS_OFFSET based on this address. If the DT contains memory blocks below this PHYS_OFFSET, report them and ignore the corresponding memory range. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
| * arm64: Fix the update_vsyscall() prototypeCatalin Marinas2012-10-181-10/+10
| | | | | | | | | | | | | | | | | | | | With commit 576094b7 (time: Introduce new GENERIC_TIME_VSYSCALL) the old update_vsyscall() prototype is no longer available. This patch updates the arm64 port. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Cc: John Stultz <john.stultz@linaro.org>
| * arm64: Select MODULES_USE_ELF_RELACatalin Marinas2012-10-181-0/+1
| | | | | | | | | | | | | | | | | | With commit 786d35d4 (make most arch asm/module.h files use asm-generic/module.h) arm64 needs to enable MODULES_USE_ELF_RELA for loadable modules. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Will Deacon <Will.Deacon@arm.com>
| * arm64: Remove duplicate inclusion of mmu_context.h in smp.cSachin Kamat2012-10-161-1/+0
| | | | | | | | | | | | | | asm/mmu_context.h was included twice. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
* | use clamp_t in UNAME26 fixKees Cook2012-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The min/max call needed to have explicit types on some architectures (e.g. mn10300). Use clamp_t instead to avoid the warning: kernel/sys.c: In function 'override_release': kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'perf-urgent-for-linus' of ↵Linus Torvalds2012-10-199-17/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Ingo Molnar: "Assorted small fixes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf python: Properly link with libtraceevent perf hists browser: Add back callchain folding symbol perf tools: Fix build on sparc. perf python: Link with libtraceevent perf python: Initialize 'page_size' variable tools lib traceevent: Fix missed freeing of subargs in free_arg() in filter lib tools traceevent: Add back pevent assignment in __pevent_parse_format() perf hists browser: Fix off-by-two bug on the first column perf tools: Remove warnings on JIT samples for srcline sort key perf tools: Fix segfault when using srcline sort key perf: Require exclude_guest to use PEBS - kernel side enforcement perf tool: Precise mode requires exclude_guest
| * | perf python: Properly link with libtraceeventArnaldo Carvalho de Melo2012-10-203-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namhyung Kim reported that the build fails with: GEN python/perf.so gcc: error: python_ext_build/tmp//../../libtraceevent.a: No such file or directory error: command 'gcc' failed with exit status 1 cp: cannot stat `python_ext_build/lib/perf.so': No such file or directory make: *** [python/perf.so] Error 1 We need to propagate the TE_PATH variable to the setup.py file. Reported-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: http://lkml.kernel.org/n/tip-8umiPbm4sxpknKivbjgykhut@git.kernel.org [ Fixed superfluous variable build error. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
OpenPOWER on IntegriCloud