]> err.no Git - linux-2.6/log
linux-2.6
16 years agoNFS - fix potential NULL pointer dereference v2
Cyrill Gorcunov [Thu, 17 Apr 2008 16:42:09 +0000 (20:42 +0400)]
NFS - fix potential NULL pointer dereference v2

There is possible NULL pointer dereference if kstr[n]dup failed.
So fix them for safety.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Don't change the RPCSEC_GSS context on a credential that is in use
Trond Myklebust [Thu, 17 Apr 2008 21:03:58 +0000 (17:03 -0400)]
SUNRPC: Don't change the RPCSEC_GSS context on a credential that is in use

When a server rejects our credential with an AUTH_REJECTEDCRED or similar,
we need to refresh the credential and then retry the request.
However, we do want to allow any requests that are in flight to finish
executing, so that we can at least attempt to process the replies that
depend on this instance of the credential.

The solution is to ensure that gss_refresh() looks up an entirely new
RPCSEC_GSS credential instead of attempting to create a context for the
existing invalid credential.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Fix a race in gss_refresh_upcall()
Trond Myklebust [Thu, 17 Apr 2008 20:53:01 +0000 (16:53 -0400)]
SUNRPC: Fix a race in gss_refresh_upcall()

If the downcall completes before we get the spin_lock then we currently
fail to refresh the credential.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests
Trond Myklebust [Thu, 17 Apr 2008 20:52:57 +0000 (16:52 -0400)]
SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests

NFSv4 requires us to ensure that we break the TCP connection before we're
allowed to retransmit a request. However in the case where we're
retransmitting several requests that have been sent on the same
connection, we need to ensure that we don't interfere with the attempt to
reconnect and/or break the connection again once it has been established.

We therefore introduce a 'connection' cookie that is bumped every time a
connection is broken. This allows requests to track if they need to force a
disconnection.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Remove the unused export of xprt_force_disconnect
Trond Myklebust [Thu, 17 Apr 2008 18:00:47 +0000 (14:00 -0400)]
SUNRPC: Remove the unused export of xprt_force_disconnect

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: remove XS_SENDMSG_RETRY
Trond Myklebust [Wed, 16 Apr 2008 20:51:38 +0000 (16:51 -0400)]
SUNRPC: remove XS_SENDMSG_RETRY

The condition for exiting from the loop in xs_tcp_send_request() should be
that we find we're not making progress (i.e. number of bytes sent is 0).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Protect creds against early garbage collection
Trond Myklebust [Mon, 14 Apr 2008 22:13:37 +0000 (18:13 -0400)]
SUNRPC: Protect creds against early garbage collection

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Attempt to use machine credentials in SETCLIENTID calls
Trond Myklebust [Tue, 8 Apr 2008 20:02:17 +0000 (16:02 -0400)]
NFSv4: Attempt to use machine credentials in SETCLIENTID calls

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Reintroduce machine creds
Trond Myklebust [Tue, 8 Apr 2008 00:50:11 +0000 (20:50 -0400)]
NFSv4: Reintroduce machine creds

We need to try to ensure that we always use the same credentials whenever
we re-establish the clientid on the server. If not, the server won't
recognise that we're the same client, and so may not allow us to recover
state.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid()
Trond Myklebust [Tue, 8 Apr 2008 00:49:28 +0000 (20:49 -0400)]
NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid()

With the recent change to generic creds, we can no longer use
cred->cr_ops->cr_name to distinguish between RPCSEC_GSS principals and
AUTH_SYS/AUTH_NULL identities. Replace it with the rpc_authops->au_name
instead...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agonfs: fix printout of multiword bitfields
Fred Isaman [Wed, 2 Apr 2008 12:21:15 +0000 (15:21 +0300)]
nfs: fix printout of multiword bitfields

Benny points out that zero-padding of multiword bitfields is necessary,
and that delimiting each word is nice to avoid endianess confusion.

bhalevy: without zero padding output can be ambiguous. Also,
since the printed array of two 32-bit unsigned integers is not a
64-bit number, delimiting the output with a semicolon makes more sense.

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agonfs: return negative error value from nfs{,4}_stat_to_errno
Benny Halevy [Mon, 31 Mar 2008 14:39:06 +0000 (17:39 +0300)]
nfs: return negative error value from nfs{,4}_stat_to_errno

All use sites for nfs{,4}_stat_to_errno negate their return value.
It's more efficient to return a negative error from the stat_to_errno convertors
rather than negating its return value everywhere. This also produces slightly
smaller code.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: Ensure client locking calls use correct credentials
Trond Myklebust [Wed, 2 Apr 2008 18:44:05 +0000 (14:44 -0400)]
NLM/lockd: Ensure client locking calls use correct credentials

Now that we've added the 'generic' credentials (that are independent of the
rpc_client) to the nfs_open_context, we can use those in the NLM client to
ensure that the lock/unlock requests are authenticated to whoever
originally opened the file.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Remove the buggy lock-if-signalled case from do_setlk()
Trond Myklebust [Wed, 2 Apr 2008 00:26:52 +0000 (20:26 -0400)]
NFS: Remove the buggy lock-if-signalled case from do_setlk()

Both NLM and NFSv4 should be able to clean up adequately in the case where
the user interrupts the RPC call...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: Fix a race when cancelling a blocking lock
Trond Myklebust [Wed, 2 Apr 2008 00:26:22 +0000 (20:26 -0400)]
NLM/lockd: Fix a race when cancelling a blocking lock

We shouldn't remove the lock from the list of blocked locks until the
CANCEL call has completed since we may be racing with a GRANTED callback.

Also ensure that we send an UNLOCK if the CANCEL request failed. Normally
that should only happen if the process gets hit with a fatal signal.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call
Trond Myklebust [Wed, 2 Apr 2008 18:40:53 +0000 (14:40 -0400)]
NLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call

Currently, it returns success as long as the RPC call was sent. We'd like
to know if the CANCEL operation succeeded on the server.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM: Remove the signal masking in nlmclnt_proc/nlmclnt_cancel
Trond Myklebust [Fri, 28 Mar 2008 20:04:51 +0000 (16:04 -0400)]
NLM: Remove the signal masking in nlmclnt_proc/nlmclnt_cancel

The signal masks have been rendered obsolete by the preceding patch.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: convert __nlm_async_call to use rpc_run_task()
Trond Myklebust [Fri, 28 Mar 2008 20:04:36 +0000 (16:04 -0400)]
NLM/lockd: convert __nlm_async_call to use rpc_run_task()

Peter Staubach comments:

> In the course of investigating testing failures in the locking phase of
> the Connectathon testsuite, I discovered a couple of things.  One was
> that one of the tests in the locking tests was racy when it didn't seem
> to need to be and two, that the NFS client asynchronously releases locks
> when a process is exiting.
...
> The Single UNIX Specification Version 3 specifies that:  "All locks
> associated with a file for a given process shall be removed when a file
> descriptor for that file is closed by that process or the process holding
> that file descriptor terminates.".
>
> This does not specify whether those locks must be released prior to the
> completion of the exit processing for the process or not.  However,
> general assumptions seem to be that those locks will be released.  This
> leads to more deterministic behavior under normal circumstances.

The following patch converts the NFSv2/v3 locking code to use the same
mechanism as NFSv4 for sending asynchronous RPC calls and then waiting for
them to complete. This ensures that the UNLOCK and CANCEL RPC calls will
complete even if the user interrupts the call, yet satisfies the
above request for synchronous behaviour on process exit.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: Add a reference counter to struct nlm_rqst
Trond Myklebust [Tue, 1 Apr 2008 22:58:49 +0000 (18:58 -0400)]
NLM/lockd: Add a reference counter to struct nlm_rqst

When we replace the existing synchronous RPC calls with asynchronous calls,
the reference count will be needed in order to allow us to examine the
result of the RPC call.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Ensure we don't corrupt fl->fl_flags in nfs4_proc_unlck
Trond Myklebust [Fri, 4 Apr 2008 19:08:02 +0000 (15:08 -0400)]
NFSv4: Ensure we don't corrupt fl->fl_flags in nfs4_proc_unlck

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM/lockd: Ensure we don't corrupt fl->fl_flags in nlmclnt_unlock()
Trond Myklebust [Tue, 1 Apr 2008 22:57:06 +0000 (18:57 -0400)]
NLM/lockd: Ensure we don't corrupt fl->fl_flags in nlmclnt_unlock()

Also fix up nlmclnt_lock() so that it doesn't pass modified versions of
fl->fl_flags to nlmclnt_cancel() and other helpers.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Fix read ordering problems with req->rq_private_buf.len
Trond Myklebust [Fri, 21 Mar 2008 20:19:41 +0000 (16:19 -0400)]
SUNRPC: Fix read ordering problems with req->rq_private_buf.len

We want to ensure that req->rq_private_buf.len is updated before
req->rq_received, so that call_decode() doesn't use an old value for
req->rq_rcv_buf.len.

In 'call_decode()' itself, instead of using task->tk_status (which is set
using req->rq_received) must use the actual value of
req->rq_private_buf.len when deciding whether or not the received RPC reply
is too short.

Finally ensure that we set req->rq_rcv_buf.len to zero when retrying a
request. A typo meant that we were resetting req->rq_private_buf.len in
call_decode(), and then clobbering that value with the old rq_rcv_buf.len
again in xprt_transmit().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Only increment the sequence id if the server saw it
Trond Myklebust [Mon, 7 Apr 2008 17:20:54 +0000 (13:20 -0400)]
NFSv4: Only increment the sequence id if the server saw it

It is quite possible that the OPEN, CLOSE, LOCK, LOCKU,... compounds fail
before the actual stateful operation has been executed (for instance in the
PUTFH call). There is no way to tell from the overall status result which
operations were executed from the COMPOUND.

The fix is to move incrementing of the sequence id into the XDR layer,
so that we do it as we process the results from the stateful operation.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFSv4: Remove bogus call to nfs4_drop_state_owner() in _nfs4_open_expired()
Trond Myklebust [Sat, 5 Apr 2008 19:54:17 +0000 (15:54 -0400)]
NFSv4: Remove bogus call to nfs4_drop_state_owner() in _nfs4_open_expired()

There should be no need to invalidate a perfectly good state owner just
because of a stale filehandle. Doing so can cause the state recovery code
to break, since nfs4_get_renew_cred() and nfs4_get_setclientid_cred() rely
on finding active state owners.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Ensure that rpc_run_task() errors are propagated back to the caller
Trond Myklebust [Mon, 14 Apr 2008 18:54:53 +0000 (14:54 -0400)]
NFS: Ensure that rpc_run_task() errors are propagated back to the caller

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Ensure that the write code cleans up properly when rpc_run_task() fails
Trond Myklebust [Tue, 15 Apr 2008 20:56:39 +0000 (16:56 -0400)]
NFS: Ensure that the write code cleans up properly when rpc_run_task() fails

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Ensure that the read code cleans up properly when rpc_run_task() fails
Trond Myklebust [Tue, 15 Apr 2008 20:33:58 +0000 (16:33 -0400)]
NFS: Ensure that the read code cleans up properly when rpc_run_task() fails

In the case of readpage() we need to ensure that the pages get unlocked,
and that the error is flagged.

In the case of O_DIRECT, we need to ensure that the pages are all released.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Fix nfs_wb_page() to always exit with an error or a clean page
Trond Myklebust [Fri, 11 Apr 2008 20:03:54 +0000 (16:03 -0400)]
NFS: Fix nfs_wb_page() to always exit with an error or a clean page

It is possible for nfs_wb_page() to sometimes exit with 0 return value, yet
the page is left in a dirty state.
For instance in the case where the server rebooted, and the COMMIT request
failed, then all the previously "clean" pages which were cached by the
server, but were not guaranteed to have been writted out to disk,
have to be redirtied and resent to the server.
The fix is to have nfs_wb_page_priority() check that the page is clean
before it exits...

This fixes a condition that triggers the BUG_ON(PagePrivate(page)) in
nfs_create_request() when we're in the nfs_readpage() path.

Also eliminate a redundant BUG_ON(!PageLocked(page)) while we're at it. It
turns out that clear_page_dirty_for_io() has the exact same test.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Don't attempt to destroy expired RPCSEC_GSS credentials..
Trond Myklebust [Sat, 19 Apr 2008 18:22:31 +0000 (14:22 -0400)]
SUNRPC: Don't attempt to destroy expired RPCSEC_GSS credentials..

..and always destroy using a 'soft' RPC call. Destroying GSS credentials
isn't mandatory; the server can always cope with a few credentials not
getting destroyed in a timely fashion.

This actually fixes a hang situation. Basically, some servers will decide
that the client is crazy if it tries to destroy an RPC context for which
they have sent an RPCSEC_GSS_CREDPROBLEM, and so will refuse to talk to it
for a while.
The regression therefor probably was introduced by commit
0df7fb74fbb709591301871a38aac7735a1d6583.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Fix up xprt_write_space()
Trond Myklebust [Thu, 17 Apr 2008 22:52:19 +0000 (18:52 -0400)]
SUNRPC: Fix up xprt_write_space()

The rest of the networking layer uses SOCK_ASYNC_NOSPACE to signal whether
or not we have someone waiting for buffer memory. Convert the SUNRPC layer
to use the same idiom.
Remove the unlikely()s in xs_udp_write_space and xs_tcp_write_space. In
fact, the most common case will be that there is nobody waiting for buffer
space.

SOCK_NOSPACE is there to tell the TCP layer whether or not the cwnd was
limited by the application window. Ensure that we follow the same idiom as
the rest of the networking layer here too.

Finally, ensure that we clear SOCK_ASYNC_NOSPACE once we wake up, so that
write_space() doesn't keep waking things up on xprt->pending.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Fix a bug in call_decode()
Trond Myklebust [Sat, 19 Apr 2008 17:15:47 +0000 (13:15 -0400)]
SUNRPC: Fix a bug in call_decode()

call_verify() can, under certain circumstances, free the RPC slot. In that
case, our cached pointer 'req = task->tk_rqstp' is invalid. Bug was
introduced in commit 220bcc2afd7011b3e0569fc178331fa983c92c1b (SUNRPC:
Don't call xprt_release in call refresh).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: introduce new function to encode private argument in SM_MON requests
Chuck Lever [Fri, 14 Mar 2008 18:26:08 +0000 (14:26 -0400)]
lockd: introduce new function to encode private argument in SM_MON requests

Clean up: refactor the encoding of the opaque 16-byte private argument in
xdr_encode_mon().  This will be updated later to support IPv6 addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: Fix up incorrect RPC buffer size calculations.
Chuck Lever [Fri, 14 Mar 2008 18:26:01 +0000 (14:26 -0400)]
lockd: Fix up incorrect RPC buffer size calculations.

Switch to using the new mon_id encoder function.

Now that we've refactored the encoding of SM_MON requests, we've
discovered that the pre-computed buffer length maximums are
incorrect!

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: document use of mon_id argument in SM_MON requests
Chuck Lever [Fri, 14 Mar 2008 18:25:53 +0000 (14:25 -0400)]
lockd: document use of mon_id argument in SM_MON requests

Clean up: document the argument type that xdr_encode_common() is
marshalling by introducing a new function.  The new function will replace
xdr_encode_common() in just a sec.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: refactor SM_MON my_id argument encoder
Chuck Lever [Fri, 14 Mar 2008 18:25:46 +0000 (14:25 -0400)]
lockd: refactor SM_MON my_id argument encoder

Clean up: introduce a new XDR encoder specifically for the my_id
argument of SM_MON requests.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: refactor SM_MON mon_name argument encoder
Chuck Lever [Fri, 14 Mar 2008 18:25:39 +0000 (14:25 -0400)]
lockd: refactor SM_MON mon_name argument encoder

Clean up: introduce a new XDR encoder specifically for the mon_name
argument of SM_MON requests.  This will be updated later to support IPv6
addresses in addition to IPv4 addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: Ensure NSM strings aren't longer than protocol allows
Chuck Lever [Fri, 14 Mar 2008 18:25:32 +0000 (14:25 -0400)]
lockd: Ensure NSM strings aren't longer than protocol allows

Introduce a special helper function to check the length of NSM strings
before they are placed on the wire.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agolockd: bring a few function declarations up to date
Chuck Lever [Fri, 14 Mar 2008 18:18:45 +0000 (14:18 -0400)]
lockd: bring a few function declarations up to date

Clean-up: replace  __inline__ and use up-to-date function declaration
conventions.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM: NLM protocol version numbers are u32
Chuck Lever [Fri, 14 Mar 2008 18:18:37 +0000 (14:18 -0400)]
NLM: NLM protocol version numbers are u32

Clean up: RPC protocol version numbers are u32.  Make sure we use an
appropriate type for NLM version numbers when calling nlm_lookup_host().

Eliminates a harmless mixed sign comparison in nlm_host_lookup().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNLM: LOCKD fails to load if CONFIG_SYSCTL is not set
Chuck Lever [Fri, 14 Mar 2008 18:18:30 +0000 (14:18 -0400)]
NLM: LOCKD fails to load if CONFIG_SYSCTL is not set

Bruce Fields says:
"By the way, we've got another config-related nit here:

http://bugzilla.linux-nfs.org/show_bug.cgi?id=156

You can build lockd without CONFIG_SYSCTL set, but then the module will
fail to load."

For now, disable the sysctl registration calls in lockd if CONFIG_SYSCTL
is not enabled.  This allows the kernel to build properly if PROC_FS or
SYSCTL is not enabled, but an NFS client is desired.

In the long run, we would like to be able to build the kernel with an
NFS client but without lockd.  This makes sense, for example, if you want
an NFSv4-only NFS client, as NFSv4 doesn't use NLM at all.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Add a default setting for CONFIG_SUNRPC_BIND34
Chuck Lever [Fri, 14 Mar 2008 18:15:18 +0000 (14:15 -0400)]
SUNRPC: Add a default setting for CONFIG_SUNRPC_BIND34

Most distros will want support for rpcbind protocols 3 and 4 to default off
until they have integrated user-space support for the new rpcbind daemon
which supports IPv6 RPC services.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoSUNRPC: Update help Kconfig text
Chuck Lever [Fri, 14 Mar 2008 18:15:11 +0000 (14:15 -0400)]
SUNRPC: Update help Kconfig text

Clean up: refresh the help text for Kconfig items related to the sunrpc
module.  Remove obsolete URLs, and make the language consistent among
the options.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Always enable NFS direct I/O
Chuck Lever [Fri, 14 Mar 2008 18:14:56 +0000 (14:14 -0400)]
NFS: Always enable NFS direct I/O

Since O_DIRECT is a standard feature that is enabled in most distros,
eliminate the CONFIG_NFS_DIRECTIO build option, and change the
fs/nfs/Makefile to always build in the NFS direct I/O engine.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Show most mount options via nfs_show_options()
Chuck Lever [Fri, 14 Mar 2008 18:10:37 +0000 (14:10 -0400)]
NFS: Show most mount options via nfs_show_options()

Display all mount options in /proc/mount which may be needed to reconstruct
a previous mount.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Save the values of the "mount*=" mount options
Chuck Lever [Fri, 14 Mar 2008 18:10:30 +0000 (14:10 -0400)]
NFS: Save the values of the "mount*=" mount options

Save the value of the mountproto= mountport= mountvers= and mountaddr=
options so that these values can be displayed later via
nfs_show_options().

This preserves the intent of the original mount options, should the file
system need to be remounted based on what's displayed in /proc/mounts.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Save the value of the "port=" mount option
Chuck Lever [Fri, 14 Mar 2008 18:10:22 +0000 (14:10 -0400)]
NFS: Save the value of the "port=" mount option

During a remount based on the mount options displayed in /proc/mounts, we
want to preserve the original behavior of the mount request.  Let's save
the original setting of the "port=" mount option in the mount's nfs_server
structure.

This allows us to simplify the default behavior of port setting for NFSv4
mounts: by default, NFSv2/3 mounts first try an RPC bind to determine the
NFS server's port, unless the user specified the "port=" mount option;
Users can force the client to skip the RPC bind by explicitly specifying
"port=<value>".

NFSv4, by contrast, assumes the NFS server port is 2049 and skips the RPC
bind, unless the user specifies "port=".  Users can force an RPC bind for
NFSv4 by explicitly specifying "port=0".

I added a couple of extra comments to clarify this behavior.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Fix up data types of fields in nfs_parsed_mount_options
Chuck Lever [Fri, 14 Mar 2008 18:10:15 +0000 (14:10 -0400)]
NFS: Fix up data types of fields in nfs_parsed_mount_options

Clean up: make data types of fields in nfs_parsed_mount_options more
consistent with other uses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: numeric mount parameters are unsigned
Chuck Lever [Fri, 14 Mar 2008 18:10:08 +0000 (14:10 -0400)]
NFS: numeric mount parameters are unsigned

Clean up: use %u instead of %d when displaying NFS mount options.

Nit: Fix reporting of "namlen=" option in nfs_show_mount_stats.  The mount
option is called "namlen" without the "e".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: clean up short packet handling for NFSv4 readdir
Jeff Layton [Fri, 22 Feb 2008 19:50:01 +0000 (14:50 -0500)]
NFS: clean up short packet handling for NFSv4 readdir

Currently, the NFS readdir decoders have a workaround for buggy servers
that send an empty readdir response with the EOF bit unset. If the
server sends a malformed response in some cases, this workaround kicks
in and just returns an empty response rather than returning a proper
error to the caller.

This patch does 3 things:

1) have malformed responses with no entries return error (-EIO)

2) preserve existing workaround for servers that send empty
   responses with the EOF marker unset.

3) Add some comments to clarify the logic in decode_readdir().

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: clean up short packet handling for NFSv3 readdir
Jeff Layton [Fri, 22 Feb 2008 19:50:00 +0000 (14:50 -0500)]
NFS: clean up short packet handling for NFSv3 readdir

Currently, the NFS readdir decoders have a workaround for buggy servers
that send an empty readdir response with the EOF bit unset. If the
server sends a malformed response in some cases, this workaround kicks
in and just returns an empty response rather than returning a proper
error to the caller.

This patch does 3 things:

1) have malformed responses with no entries return error (-EIO)

2) preserve existing workaround for servers that send empty
   responses with the EOF marker unset.

3) Add some comments to clarify the logic in nfs3_xdr_readdirres().

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: clean up short packet handling for NFSv2 readdir
Jeff Layton [Fri, 22 Feb 2008 19:49:59 +0000 (14:49 -0500)]
NFS: clean up short packet handling for NFSv2 readdir

Currently, the NFS readdir decoders have a workaround for buggy servers
that send an empty readdir response with the EOF bit unset. If the
server sends a malformed response in some cases, this workaround kicks
in and just returns an empty response rather than returning a proper
error to the caller.

This patch does 3 things:

1) have malformed responses with no entries return error (-EIO)

2) preserve existing workaround for servers that send empty
   responses with the EOF marker unset.

3) Add some comments to clarify the logic in nfs_xdr_readdirres().

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agonfs: remove duplicate initializations of nfs_read_data field
Fred Isaman [Wed, 19 Mar 2008 15:54:04 +0000 (11:54 -0400)]
nfs: remove duplicate initializations of nfs_read_data field

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agonfs: nfs_redirty_request
Fred [Wed, 19 Mar 2008 15:24:38 +0000 (11:24 -0400)]
nfs: nfs_redirty_request

Both flush functions have the same error handling routine.  Pull
it out as a function.

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoMerge branch 'hotfixes' into devel
Trond Myklebust [Wed, 19 Mar 2008 21:59:44 +0000 (17:59 -0400)]
Merge branch 'hotfixes' into devel

16 years agonfs: don't ignore return value from nfs_pageio_add_request
Fred Isaman [Wed, 19 Mar 2008 15:24:39 +0000 (11:24 -0400)]
nfs: don't ignore return value from nfs_pageio_add_request

Ignoring the return value from nfs_pageio_add_request can cause deadlocks.

In read path:
  call nfs_pageio_add_request from readpage_async_filler
  assume at this point that there are requests already in desc, that
    can't be merged with the current request.
  so nfs_pageio_doio is fired up to clear out desc.
  assume something goes wrong in setting up the io, so desc->pg_error is set.
  This causes nfs_pageio_add_request to return 0, *WITHOUT* adding the original
    request.
  BUT, since return code is ignored, readpage_async_filler assumes it has
    been added, and does nothing further, leaving page locked.
  do_generic_mapping_read will eventually call lock_page, resulting in deadlock

In write path:
  page is marked dirty by generic_perform_write
  nfs_writepages is called
  call nfs_pageio_add_request from nfs_page_async_flush
  assume at this point that there are requests already in desc, that
    can't be merged with the current request.
  so nfs_pageio_doio is fired up to clear out desc.
  assume something goes wrong in setting up the io, so desc->pg_error is set.
  This causes nfs_page_async_flush to return 0, *WITHOUT* adding the original
    request, yet marking the request as locked (PG_BUSY) and in writeback,
    clearing dirty marks.
  The next time a write is done to the page, deadlock will result as
    nfs_write_end calls nfs_update_request

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
Linus Torvalds [Wed, 19 Mar 2008 04:34:48 +0000 (21:34 -0700)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor
  fsldma: Fix the DMA halt when using DMA_INTERRUPT async_tx transfer.

16 years agoRevert "ACPI: EC: Handle IRQ storm on Acer laptops"
Alexey Starikovskiy [Tue, 18 Mar 2008 23:45:12 +0000 (02:45 +0300)]
Revert "ACPI: EC: Handle IRQ storm on Acer laptops"

This reverts commit 2c81ce4c9c37b910210f2640c28e98a0c398dc26.

It caused several new troubles (eg suspend slowdown bisected down to
this patch by Pavel Machek), so just revert it for now.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux...
Linus Torvalds [Wed, 19 Mar 2008 04:27:13 +0000 (21:27 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel:
  sched: tune multi-core idle balancing
  sched: retune wake granularity
  sched: wakeup-buddy tasks are cache-hot
  sched: improve affine wakeups
  sched, net: socket wakeups are sync
  sched: clean up wakeup balancing, code flow
  sched: clean up wakeup balancing, rename variables
  sched: clean up wakeup balancing, move wake_affine()

16 years agoIDE: Make taskfile interface more robust wrt unexpected end-of-command
Linus Torvalds [Wed, 19 Mar 2008 04:26:24 +0000 (21:26 -0700)]
IDE: Make taskfile interface more robust wrt unexpected end-of-command

Now that we handle all the special commands using REQ_TYPE_ATA_TASKFILE
rather than using the old REQ_TYPE_ATA_CMD model, we need to also
emulate the lack of full taskfile data that comes with the old command
model (ie when commands are generated with the HDIO_DRIVE_CMD ioctl
rather than using the HDIO_DRIVE_TASK[FILE] ioctls).

In particular, this means that we should handle command completion the
more relaxed way that the old drive_cmd_intr() code did.  It allows
commands to finish early even if they don't use up all the data that we
thought we had for them.

This fixes a regression seen by Anders Eriksson where some SMART
commands sent by smartd would cause a boot-time system hang on his
machine because the IDE command handling code didn't realize that the
command had completed.

Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'slab-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm
Linus Torvalds [Wed, 19 Mar 2008 04:13:19 +0000 (21:13 -0700)]
Merge branch 'slab-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm

* 'slab-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm:
  slub page alloc fallback: Enable interrupts for GFP_WAIT.

16 years agosched: tune multi-core idle balancing
Ingo Molnar [Sun, 16 Mar 2008 10:14:30 +0000 (11:14 +0100)]
sched: tune multi-core idle balancing

WAKE_IDLE is too agressive on multi-core CPUs with the new
wake-affine code, keep it on for SMT/HT balancing alone
(where there's no cache affinity at all between logical CPUs).

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: retune wake granularity
Ingo Molnar [Tue, 18 Mar 2008 17:47:57 +0000 (18:47 +0100)]
sched: retune wake granularity

reduce wake-up granularity for better interactivity.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: wakeup-buddy tasks are cache-hot
Ingo Molnar [Sat, 15 Mar 2008 16:10:34 +0000 (17:10 +0100)]
sched: wakeup-buddy tasks are cache-hot

Wakeup-buddy tasks are cache-hot - this makes it a bit harder
for the load-balancer to tear them apart. (but it's still possible,
if the load is sufficiently assymetric)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: improve affine wakeups
Ingo Molnar [Wed, 19 Mar 2008 00:42:00 +0000 (01:42 +0100)]
sched: improve affine wakeups

improve affine wakeups. Maintain the 'overlap' metric based on CFS's
sum_exec_runtime - which means the amount of time a task executes
after it wakes up some other task.

Use the 'overlap' for the wakeup decisions: if the 'overlap' is short,
it means there's strong workload coupling between this task and the
woken up task. If the 'overlap' is large then the workload is decoupled
and the scheduler will move them to separate CPUs more easily.

( Also slightly move the preempt_check within try_to_wake_up() - this has
  no effect on functionality but allows 'early wakeups' (for still-on-rq
  tasks) to be correctly accounted as well.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched, net: socket wakeups are sync
Ingo Molnar [Wed, 19 Mar 2008 00:44:24 +0000 (01:44 +0100)]
sched, net: socket wakeups are sync

'sync' wakeups are a hint towards the scheduler that (certain)
networking related wakeups likely create coupling between tasks.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: clean up wakeup balancing, code flow
Ingo Molnar [Sun, 16 Mar 2008 20:21:47 +0000 (21:21 +0100)]
sched: clean up wakeup balancing, code flow

Clean up the code flow. No code changed:

kernel/sched.o:

   text    data     bss     dec     hex filename
  42521    2858     232   45611    b22b sched.o.before
  42521    2858     232   45611    b22b sched.o.after

md5:
   09b31c44e9aff8666f72773dc433e2df  sched.o.before.asm
   09b31c44e9aff8666f72773dc433e2df  sched.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: clean up wakeup balancing, rename variables
Ingo Molnar [Sun, 16 Mar 2008 19:56:26 +0000 (20:56 +0100)]
sched: clean up wakeup balancing, rename variables

rename 'cpu' to 'prev_cpu'. No code changed:

kernel/sched.o:

   text    data     bss     dec     hex filename
  42521    2858     232   45611    b22b sched.o.before
  42521    2858     232   45611    b22b sched.o.after

md5:
   09b31c44e9aff8666f72773dc433e2df  sched.o.before.asm
   09b31c44e9aff8666f72773dc433e2df  sched.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosched: clean up wakeup balancing, move wake_affine()
Ingo Molnar [Sun, 16 Mar 2008 19:36:10 +0000 (20:36 +0100)]
sched: clean up wakeup balancing, move wake_affine()

split out the affine-wakeup bits.

No code changed:

kernel/sched.o:

   text    data     bss     dec     hex filename
  42521    2858     232   45611    b22b sched.o.before
  42521    2858     232   45611    b22b sched.o.after

md5:
   9d76738f1272aa82f0b7affd2f51df6b  sched.o.before.asm
   09b31c44e9aff8666f72773dc433e2df  sched.o.after.asm

(the md5's changed because stack slots changed and some registers
get scheduled by gcc in a different order - but otherwise the before
and after assembly is instruction for instruction equivalent.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoasync_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor
Dan Williams [Wed, 19 Mar 2008 04:23:59 +0000 (21:23 -0700)]
async_tx: avoid the async xor_zero_sum path when src_cnt > device->max_xor

If the channel cannot perform the operation in one call to
->device_prep_dma_zero_sum, then fallback to the xor+page_is_zero path.
This only affects users with arrays larger than 16 devices on iop13xx or
32 devices on iop3xx.

Cc: <stable@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
16 years agofsldma: Fix the DMA halt when using DMA_INTERRUPT async_tx transfer.
Zhang Wei [Wed, 19 Mar 2008 01:45:00 +0000 (18:45 -0700)]
fsldma: Fix the DMA halt when using DMA_INTERRUPT async_tx transfer.

The DMA_INTERRUPT async_tx is a NULL transfer, thus the BCR(count register)
is 0. When the transfer started with a byte count of zero, the DMA
controller will triger a PE(programming error) event and halt, not a normal
interrupt. I add special codes for PE event and DMA_INTERRUPT
async_tx testing.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
16 years agoMerge branch 'audit.b49' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
Linus Torvalds [Tue, 18 Mar 2008 15:43:59 +0000 (08:43 -0700)]
Merge branch 'audit.b49' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current

* 'audit.b49' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
  [PATCH] export sessionid alongside the loginuid in procfs

16 years ago[PATCH] export sessionid alongside the loginuid in procfs
Eric Paris [Thu, 13 Mar 2008 12:15:31 +0000 (08:15 -0400)]
[PATCH] export sessionid alongside the loginuid in procfs

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Tue, 18 Mar 2008 14:49:59 +0000 (07:49 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: update key codes for Apple aluminium
  HID: fix comment in hid_input_report()
  HID: BADPAD entry for NATSU Playstation USB adapter
  HID: Use DIV_ROUND_UP
  HID: remove HID_QUIRK_APPLE_ISO_KEYBOARD for 4th generation macbook

16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Tue, 18 Mar 2008 14:48:23 +0000 (07:48 -0700)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs
  Revert "ACPI: video: Ignore devices that aren't present in hardware"
  asus_acpi: remove misleading mask
  Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
  thermal: delete "default y"
  thermal: re-document thermal units
  Revert "thermal: fix generic thermal I/F for hwmon"
  ACPI: fix ATA_ACPI build
  ACPI: battery: Don't return -EFAIL on broken packages.
  ACPI: lockdep warning on boot, 2.6.25-rc5

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Tue, 18 Mar 2008 14:46:19 +0000 (07:46 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ALPS - fix forward/back buttons reversed on Acer 5520-5290
  Input: ALPS - put secondary device in proper place in sysfs
  Input: wacom - add support for Bamboo1, BambooFun, and Cintiq 12WX
  Input: document i8042.noloop
  Input: add keyboard notifier documentation
  Input: ads7846 - fix uninitialized var warning
  Input: i8042 - add SNI RM support
  Input: i8042 - add Lenovo 3000 N100 to nomux blacklist
  Input: i8042 - fix warning on non-x86 builds
  Input: cobalt_btns - assorted fixes

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Tue, 18 Mar 2008 14:44:21 +0000 (07:44 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  make selinux_parse_opts_str() static

16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 18 Mar 2008 14:43:14 +0000 (07:43 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Revert "unexport bio_{,un}map_user"
  relay: fix subbuf_splice_actor() adding too many pages
  The ps2esdi driver was marked as BROKEN more than two years ago due to being

16 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 18 Mar 2008 14:32:23 +0000 (07:32 -0700)]
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/ati_pcigart: fix the PCIGART to use drm_pci to allocate GART table.
  drm/radeon: fixup RV550 chip family
  drm/via: attempt again to stabilise the AGP DMA command submission.
  drm: Fix race that can lockup the kernel

16 years agoHID: update key codes for Apple aluminium
Michael Hanselmann [Mon, 17 Mar 2008 21:23:52 +0000 (22:23 +0100)]
HID: update key codes for Apple aluminium

F5 and F6 have no second function printed on them. Thus their definitions have
been removed from the table.

KEY_CYCLEWINDOWS doesn't name the function of Mac OS X' Expose properly and
because we couldn't find a better key code, we decided to use KEY_FN_F4
instead.

We also changed KEY_BACK and KEY_FORWARD, which apply to browser functions, to
KEY_PREVIOUSSONG and KEY_NEXTSONG, since the keys are intended to control a
music player.

Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years agoHID: fix comment in hid_input_report()
Jiri Kosina [Tue, 4 Mar 2008 12:53:33 +0000 (13:53 +0100)]
HID: fix comment in hid_input_report()

The hid_input_report() in debug mode of course outputs the report itself, not
the device report descriptor.

Fix this error in comment.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years agoHID: BADPAD entry for NATSU Playstation USB adapter
Andrew Burton [Mon, 3 Mar 2008 09:49:59 +0000 (10:49 +0100)]
HID: BADPAD entry for NATSU Playstation USB adapter

Add quirk entry for BADPAD for the NATSU Playstation USB adapter. The
adapter is supported under Linux, but with bad direction detection.

Signed-off-by: Andrew Burton <adb@iinet.net.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years agoHID: Use DIV_ROUND_UP
Julia Lawall [Fri, 15 Feb 2008 12:53:11 +0000 (13:53 +0100)]
HID: Use DIV_ROUND_UP

The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years agoHID: remove HID_QUIRK_APPLE_ISO_KEYBOARD for 4th generation macbook
Tobias Mueller [Fri, 14 Mar 2008 22:44:48 +0000 (23:44 +0100)]
HID: remove HID_QUIRK_APPLE_ISO_KEYBOARD for 4th generation macbook

4th generation MacBook (product id 0x022a) from Apple doesn't need
HID_QUIRK_APPLE_ISO_KEYBOARD fix anymore.

Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years agoMerge branches 'release' and 'dock' into release
Len Brown [Tue, 18 Mar 2008 09:17:15 +0000 (05:17 -0400)]
Merge branches 'release' and 'dock' into release

16 years agoACPI: Set flag DOCK_UNDOCKING when triggered via sysfs
Holger Macht [Wed, 12 Mar 2008 00:07:27 +0000 (01:07 +0100)]
ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs

begin_undock() is only called when triggered via a acpi notify handler
(pressing the undock button on the dock station), but complete_undock() is
always called after the eject. So if a undock is triggered through a sysfs
write, the flag DOCK_UNDOCKING has to be set for the dock station,
too. Otherwise this will freeze the system hard.

Signed-off-by: Holger Macht <hmacht@suse.de>
Acked-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoMerge branches 'release', 'asus', 'bugzilla-8573', 'bugzilla-9995', 'bugzilla-10272...
Len Brown [Tue, 18 Mar 2008 08:52:57 +0000 (04:52 -0400)]
Merge branches 'release', 'asus', 'bugzilla-8573', 'bugzilla-9995', 'bugzilla-10272', 'lockdep' and 'thermal' into release

16 years agoRevert "ACPI: video: Ignore devices that aren't present in hardware"
Len Brown [Tue, 18 Mar 2008 08:04:35 +0000 (04:04 -0400)]
Revert "ACPI: video: Ignore devices that aren't present in hardware"

This reverts commit 0119509c4fbc9adcef1472817fda295334612976.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoasus_acpi: remove misleading mask
Julia Lawall [Tue, 4 Mar 2008 23:00:13 +0000 (15:00 -0800)]
asus_acpi: remove misleading mask

led_out is boolean, so there is no functional change here,
but apparently an extra mask with 1 caused some style checkers
to flag this as logic bug.

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoRevert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
Len Brown [Tue, 18 Mar 2008 05:43:53 +0000 (01:43 -0400)]
Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"

This reverts commit 3fa2cdcc45a0176de15cac9dbf4ed2834ebf8932.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown>
16 years agothermal: delete "default y"
Len Brown [Tue, 18 Mar 2008 05:22:10 +0000 (01:22 -0400)]
thermal: delete "default y"

The generic thermal I/F gets selected by ACPI_THERMAL --
its only current customer.
it doesn't need to clutter other configs by default.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: re-document thermal units
Zhang, Rui [Tue, 18 Mar 2008 02:40:29 +0000 (10:40 +0800)]
thermal: re-document thermal units
From: Zhang Rui <rui.zhang@intel.com>

(reverting the previous sysfs patch also reverted a fix
 to the thermal units documentation, which is restored by this commit)

The generic thermal driver shows temperature in millidegree Celsius.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoRevert "thermal: fix generic thermal I/F for hwmon"
Len Brown [Tue, 18 Mar 2008 05:14:37 +0000 (01:14 -0400)]
Revert "thermal: fix generic thermal I/F for hwmon"

This reverts commit 3152fb9f11cdd2fd8688c2c5cb805e5c09b53dd9.

This broke libsensors.

Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoInput: ALPS - fix forward/back buttons reversed on Acer 5520-5290
Laszlo Kajan [Tue, 18 Mar 2008 04:39:55 +0000 (00:39 -0400)]
Input: ALPS - fix forward/back buttons reversed on Acer 5520-5290

ALPS_FW_BK_1 protocol flavor seems to have forward and backward
keys reversed.

Signed-off-by: Laszlo Kajan <kajla@bioinfo.pl>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
16 years agoInput: ALPS - put secondary device in proper place in sysfs
Dmitry Torokhov [Tue, 18 Mar 2008 04:29:18 +0000 (00:29 -0400)]
Input: ALPS - put secondary device in proper place in sysfs

Secondary input device did not have parent set up causing it
to appear in the root of sysfs device hierarchy.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
16 years agoACPI: fix ATA_ACPI build
Len Brown [Tue, 18 Mar 2008 04:26:07 +0000 (00:26 -0400)]
ACPI: fix ATA_ACPI build

drivers/ata/libata-acpi.c fails to build

drivers/built-in.o: In function `ata_acpi_associate':
(.text+0x7106a): undefined reference to `register_hotplug_dock_device'

When CONFIG_ATA_ACPI=y and CONFIG_ACPI_DOCK=m
But if dock is selected from ata_acpi, dock will =y
when ata_acpi=y, avoiding this problem.

http://bugzilla.kernel.org/show_bug.cgi?id=10272

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: battery: Don't return -EFAIL on broken packages.
Alexey Starikovskiy [Tue, 18 Mar 2008 02:37:42 +0000 (22:37 -0400)]
ACPI: battery: Don't return -EFAIL on broken packages.

Acer BIOS has a bug which is exposed when a dead battery is present.

The package template that is used to describe battery status is
over-written with sane values when the battery is live.
But when the batter is dead, a bogus reference in the template
is used.  In this case, Linux returns a fault, when instead
it should simply return that it doesn't know the missing value.

http://bugzilla.kernel.org/show_bug.cgi?id=8573
http://bugzilla.kernel.org/show_bug.cgi?id=10202

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agopciehp: don't enable slot unless forced
Mark Lord [Mon, 17 Mar 2008 20:04:23 +0000 (16:04 -0400)]
pciehp: don't enable slot unless forced

This fixes a 2.6.25 regression reported by Alex Chiang.

Invoke pciehp_enable_slot() at startup only when pciehp_force=1.
Some HP equipment apparently cannot cope with it otherwise.

This restores the (previously working) 2.6.24 behaviour here,
while allowing machines that need a kick to use pciehp_force=1.

This was the original design back in October 2007,
but Kristen suggested we try without it first:

   Kristen Carlson Accardi wrote:
   >I think it would be ok to try allowing the slot to be enabled when not
   >using pciehp_force mode.  We can wrap it later if it proves to break things

This ended up breaking one of Alex's setups,
so it's time to put the wrapper back in now.

Signed-off-by: Mark Lord <mlord@pobox.com>
Acked-by: Alex Chiang <achiang@hp.com>
Acked-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomake selinux_parse_opts_str() static
Adrian Bunk [Mon, 17 Mar 2008 20:29:23 +0000 (22:29 +0200)]
make selinux_parse_opts_str() static

This patch makes the needlessly global selinux_parse_opts_str() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoRevert "unexport bio_{,un}map_user"
Jens Axboe [Mon, 17 Mar 2008 20:14:40 +0000 (21:14 +0100)]
Revert "unexport bio_{,un}map_user"

Outside users like asmlib uses the mapping functions. API wise, the
export is definitely sane. It's a better idea to keep this export
than to require external users to open-code this piece of code instead.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoslub page alloc fallback: Enable interrupts for GFP_WAIT.
Christoph Lameter [Thu, 13 Mar 2008 06:57:49 +0000 (23:57 -0700)]
slub page alloc fallback: Enable interrupts for GFP_WAIT.

The fallback path needs to enable interrupts like done for
the other page allocator calls. This was not necessary with
the alternate fast path since we handled irq enable/disable in
the slow path. The regular fastpath handles irq enable/disable
around calls to the slow path so we need to restore the proper
status before calling the page allocator from the slowpath.

Signed-off-by: Christoph Lameter <clameter@sgi.com>