aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-05-31sethostname/setdomainname: notify userspace when there is a change in ↵Sasikantha babu1-2/+2
uts_kern_table sethostname() and setdomainname() notify userspace on failure (without modifying uts_kern_table). Change things so that we only notify userspace on success, when uts_kern_table was actually modified. Signed-off-by: Sasikantha babu <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: WANG Cong <[email protected]> Reviewed-by: Cyrill Gorcunov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31.mailmap: add GustavoGustavo Padovan1-0/+2
Signed-off-by: Gustavo Padovan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31drivers/message/fusion: use pci_dev->revisionSergei Shtylyov2-11/+5
This driver uses PCI_CLASS_REVISION instead of PCI_REVISION_ID, so it wasn't converted by 44c10138fd4bbc ("PCI: Change all drivers to use pci_device->revision"). In one case, it even reads PCI revision ID without using it -- that code is now removed... Signed-off-by: Sergei Shtylyov <[email protected]> Acked-by: "Nandigama, Nagalakshmi" <[email protected]> Cc: Eric Moore <[email protected]> Acked-by: Auke Kok <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31kernel/resource.c: correct the comment of allocate_resource()Wei Yang1-2/+2
In the comment of allocate_resource(), the explanation of parameter max and min is not correct. Actually, these two parameters are used to specify the range of the resource that will be allocated, not the min/max size that will be allocated. Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31introduce SIZE_MAXXi Wang4-4/+5
ULONG_MAX is often used to check for integer overflow when calculating allocation size. While ULONG_MAX happens to work on most systems, there is no guarantee that `size_t' must be the same size as `long'. This patch introduces SIZE_MAX, the maximum value of `size_t', to improve portability and readability for allocation size validation. Signed-off-by: Xi Wang <[email protected]> Acked-by: Alex Elder <[email protected]> Cc: David Airlie <[email protected]> Cc: Pekka Enberg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31CodingStyle: add kmalloc_array() to memory allocatorsXi Wang1-2/+14
Add the new kmalloc_array() to the list of general-purpose memory allocators in chapter 14. Signed-off-by: Xi Wang <[email protected]> Acked-by: Jesper Juhl <[email protected]> Acked-by: Pekka Enberg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31um/kernel/trap.c: port OOM changes to handle_page_fault()Kautuk Consul1-5/+19
Commit d065bd810b6d ("mm: retry page fault when blocking on disk transfer") and commit 37b23e0525d3 ("x86,mm: make pagefault killable") introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to um. Signed-off-by: Kautuk Consul <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31security/keys/keyctl.c: suppress memory allocation failure warningAndrew Morton1-1/+1
This allocation may be large. The code is probing to see if it will succeed and if not, it falls back to vmalloc(). We should suppress any page-allocation failure messages when the fallback happens. Reported-by: Dave Jones <[email protected]> Acked-by: David Howells <[email protected]> Cc: James Morris <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-31nfsd4: fix, consolidate client_has_stateJ. Bruce Fields1-11/+4
Whoops: first, I reimplemented the already-existing has_resources without noticing; second, I got the test backwards. I did pick a better name, though. Combine the two.... Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: don't remove rebooted client record until confirmationJ. Bruce Fields1-4/+9
In the NFSv4.1 client-reboot case we're currently removing the client's previous state in exchange_id. That's wrong--we should be waiting till the confirming create_session. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: remove some dprintk's and a commentJ. Bruce Fields1-8/+0
The comment is redundant, and if we really want dprintk's here they'd probably be better in the common (check-slot_seqid) code. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: return "real" sequence id in confirmed caseJ. Bruce Fields1-1/+1
The client should ignore the returned sequence_id in the case where the CONFIRMED flag is set on an exchange_id reply--and in the unconfirmed case "1" is always the right response. So it shouldn't actually matter what we return here. We could continue returning 1 just to catch clients ignoring the spec here, but I'd rather be generous. Other things equal, returning the existing sequence_id seems more informative. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: fix exchange_id to return confirm flagJ. Bruce Fields1-1/+1
Otherwise nfsd4_set_ex_flags writes over the return flags. Reported-by: Bryan Schumaker <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: clarify that renewing expired client is a bugJ. Bruce Fields1-1/+2
This can't happen: - cl_time is zeroed only by unhash_client_locked, which is only ever called under both the state lock and the client lock. - every caller of renew_client() should have looked up a (non-expired) client and then called renew_client() all without dropping the state lock. - the only other caller of renew_client_locked() is release_session_client(), which first checks under the client_lock that the cl_time is nonzero. So make it clear that this is a bug, not something we handle. I can't quite bring myself to make this a BUG(), though, as there are a lot of renew_client() callers, and returning here is probably safer than a BUG(). We'll consider making it a BUG() after some more cleanup. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: simpler ordering of setclientid_confirm checksJ. Bruce Fields1-13/+11
The cases here divide into two main categories: - if there's an uncomfirmed record with a matching verifier, then this is a "normal", succesful case: we're either creating a new client, or updating an existing one. - otherwise, this is a weird case: a replay, or a server reboot. Reordering to reflect that makes the code a bit more concise and the logic a lot easier to understand. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: setclientid: remove pointless assignmentJ. Bruce Fields1-2/+1
Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: fix error return in non-matching-creds caseJ. Bruce Fields1-36/+26
Note CLID_INUSE is for the case where two clients are trying to use the same client-provided long-form client identifiers. But what we're looking at here is the server-returned shorthand client id--if those clash there's a bug somewhere. Fix the error return, pull the check out into common code, and do the check unconditionally in all cases. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: fix setclientid_confirm same_cred checkJ. Bruce Fields1-1/+1
New clients are created only by nfsd4_setclientid(), which always gives any new client a unique clientid. The only exception is in the "callback update" case, in which case it may create an unconfirmed client with the same clientid as a confirmed client. In that case it also checks that the confirmed client has the same credential. Therefore, it is pointless for setclientid_confirm to check whether a confirmed and unconfirmed client with the same clientid have matching credentials--they're guaranteed to. Instead, it should be checking whether the credential on the setclientid_confirm matches either of those. Otherwise, it could be anyone sending the setclientid_confirm. Granted, I can't see why anyone would, but still it's probalby safer to check. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: merge 3 setclientid cases to 2J. Bruce Fields1-7/+2
Boy, is this simpler. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: pull out common code from setclientid casesJ. Bruce Fields1-21/+5
Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: merge last two setclientid casesJ. Bruce Fields1-9/+4
The code here is mostly the same. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: setclientid/confirm comment cleanupJ. Bruce Fields1-56/+11
Be a little more concise. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: setclientid remove unnecessary terms from a logical expressionJ. Bruce Fields1-3/+2
Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: move rq_flavor into svc_credJ. Bruce Fields8-13/+13
Move the rq_flavor into struct svc_cred, and use it in setclientid and exchange_id comparisons as well. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: stricter cred comparison for setclientid/exchange_idJ. Bruce Fields1-1/+21
The typical setclientid or exchange_id will probably be performed with a credential that maps to either root or nobody, so comparing just uid's is unlikely to be useful. So, use everything else we can get our hands on. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: move principal name into svc_credJ. Bruce Fields8-41/+38
Instead of keeping the principal name associated with a request in a structure that's private to auth_gss and using an accessor function, move it to svc_cred. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: allow removing clients not holding stateJ. Bruce Fields1-2/+19
RFC 5661 actually says we should allow an exchange_id to remove a matching client, even if the exchange_id comes from a different principal, *if* the victim client lacks any state. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: rearrange exchange_id logic to simplifyJ. Bruce Fields1-20/+20
Minor cleanup: it's simpler to have separate code paths for the update and non-update cases. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: exchange_id cleanup: commentsJ. Bruce Fields1-26/+10
Make these comments a bit more concise and uniform. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: exchange_id cleanup: local shorthands for repeated testsJ. Bruce Fields1-6/+10
Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: allow an EXCHANGE_ID to kill a 4.0 clientJ. Bruce Fields1-2/+8
Following rfc 5661 section 2.4.1, we can permit a 4.1 client to remove an established 4.0 client's state. (But we don't allow updates.) Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: exchange_id: check creds before killing confirmed clientJ. Bruce Fields1-9/+8
We mustn't allow a client to destroy another client with established state unless it has the right credential. And some minor cleanup. (Note: our comparison of credentials is actually pretty bogus currently; that will need to be fixed in another patch.) Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: exchange_id error cleanupJ. Bruce Fields1-5/+1
There's no point to the dprintk here as the main proc_compound loop already does this. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd4: exchange_id has a pointless copyJ. Bruce Fields1-1/+0
We just verified above that these two verifiers are already the same. Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31svcrpc: fix a comment typoJ. Bruce Fields1-1/+1
Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd: return 0 on reads of fault injection filesWeston Andros Adamson1-0/+1
debugfs read operations were returning the contents of an uninitialized u64. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd: wrap all accesses to st_deny_bmapJeff Layton1-8/+29
Handle the st_deny_bmap in a similar fashion to the st_access_bmap. Add accessor functions and use those instead of bare bitops. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd: wrap accesses to st_access_bmapJeff Layton1-28/+54
Currently, we do this for the most part with "bare" bitops, but eventually we'll need to expand the share mode code to handle access and deny modes on other nodes. In order to facilitate that code in the future, move to some generic accessor functions. For now, these are mostly static inlines, but eventually we'll want to move these to "real" functions that are able to handle multi-node configurations or have a way to "swap in" new operations to be done in lieu of or in conjunction with these atomic bitops. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd: make test_share a bool returnJeff Layton1-3/+3
All of the callers treat the return that way already. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31nfsd: consolidate set_access and set_denyJeff Layton1-17/+7
These functions are identical. Also, rename them to bmap_to_share_mode to better reflect what they do, and have them just return the result instead of passing in a pointer to the storage location. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31NFSD: SETCLIENTID_CONFIRM returns NFS4ERR_CLID_INUSE too oftenChuck Lever1-12/+2
According to RFC 3530bis, the only items SETCLIENTID_CONFIRM processing should be concerned with is the clientid, clientid verifier, and principal. The client's IP address is not supposed to be interesting. And, NFS4ERR_CLID_INUSE is meant only for principal mismatches. I triggered this logic with a prototype UCS client -- one that uses the same nfs_client_id4 string for all servers. The client mounted our server via its IPv4, then via its IPv6 address. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: add debug message to start and stop functionsStanislav Kinsbursky1-0/+5
Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: service start function introducedStanislav Kinsbursky1-25/+42
This is just a code move, which from my POV makes the code look better. I.e. now on start we have 3 different stages: 1) Service creation. 2) Service per-net data allocation. 3) Service start. Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: move global usage counter manipulation from error pathStanislav Kinsbursky1-3/+2
Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: service creation function introducedStanislav Kinsbursky1-11/+27
This function creates service if it doesn't exist, or increases usage counter if it does, and returns a pointer to it. The usage counter will be droppepd by svc_destroy() later in lockd_up(). Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: use existing per-net data function on service creationStanislav Kinsbursky1-16/+7
This patch also replaces svc_rpcb_setup() with svc_bind(). Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31LockD: pass service to per-net up and down functionsStanislav Kinsbursky1-7/+5
Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31sunrpc: do array overrun check in svc_recv before allocating pagesJeff Layton1-1/+1
There's little point in waiting until after we allocate all of the pages to see if we're going to overrun the array. In the event that this calculation is really off we could end up scribbling over a bunch of memory and make it tougher to debug. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31SUNRPC: move per-net operations from svc_destroy()Stanislav Kinsbursky5-19/+41
The idea is to separate service destruction and per-net operations, because these are two different things and the mix looks ugly. Notes: 1) For NFS server this patch looks ugly (sorry for that). But these place will be rewritten soon during NFSd containerization. 2) LockD per-net counter increase int lockd_up() was moved prior to make_socks() to make lockd_down_net() call safe in case of error. Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2012-05-31SUNRPC: new svc_bind() routine introducedStanislav Kinsbursky6-14/+41
This new routine is responsible for service registration in a specified network context. The idea is to separate service creation from per-net operations. Note also: since registering service with svc_bind() can fail, the service will be destroyed and during destruction it will try to unregister itself from rpcbind. In this case unregistration has to be skipped. Signed-off-by: Stanislav Kinsbursky <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>