safe/jmp/linux-2.6
15 years agolockd: Add helper to sanity check incoming NOTIFY requests
Chuck Lever [Fri, 3 Oct 2008 16:50:44 +0000 (12:50 -0400)]
lockd: Add helper to sanity check incoming NOTIFY requests

lockd accepts SM_NOTIFY calls only from a privileged process on the
local system.  If lockd uses an AF_INET6 listener, the sender's address
(ie the local rpc.statd) will be the IPv6 loopback address, not the
IPv4 loopback address.

Make sure the privilege test in nlmsvc_proc_sm_notify() and
nlm4svc_proc_sm_notify() works for both AF_INET and AF_INET6 family
addresses by refactoring the test into a helper and adding support for
IPv6 addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: change nlmclnt_grant() to take a "struct sockaddr *"
Chuck Lever [Fri, 3 Oct 2008 16:50:36 +0000 (12:50 -0400)]
lockd: change nlmclnt_grant() to take a "struct sockaddr *"

Adjust the signature and callers of nlmclnt_grant() to pass a "struct
sockaddr *" instead of a "struct sockaddr_in *" in order to support IPv6
addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Adjust nlmsvc_lookup_host() to accomodate AF_INET6 addresses
Chuck Lever [Fri, 3 Oct 2008 16:50:29 +0000 (12:50 -0400)]
lockd: Adjust nlmsvc_lookup_host() to accomodate AF_INET6 addresses

Fix up nlmsvc_lookup_host() to pass AF_INET6 source addresses to
nlm_lookup_host().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Adjust nlmclnt_lookup_host() signature to accomodate non-AF_INET
Chuck Lever [Fri, 3 Oct 2008 16:50:21 +0000 (12:50 -0400)]
lockd: Adjust nlmclnt_lookup_host() signature to accomodate non-AF_INET

Pass a struct sockaddr * and a length to nlmclnt_lookup_host() to
accomodate non-AF_INET family addresses.

As a side benefit, eliminate the hostname_len argument, as the hostname
is always NUL-terminated.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Support non-AF_INET addresses in nlm_lookup_host()
Chuck Lever [Fri, 3 Oct 2008 16:50:14 +0000 (12:50 -0400)]
lockd: Support non-AF_INET addresses in nlm_lookup_host()

Use struct sockaddr * and length in nlm_lookup_host_info to all callers
to pass in either AF_INET or AF_INET6 addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoNLM: Convert nlm_lookup_host() to use a single argument
Chuck Lever [Fri, 3 Oct 2008 16:50:07 +0000 (12:50 -0400)]
NLM: Convert nlm_lookup_host() to use a single argument

The nlm_lookup_host() function already has a large number of arguments,
and I'm about to add a few more.  As a clean up, convert the function
to use a single data structure argument.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: reject reclaims outside the grace period
J. Bruce Fields [Wed, 6 Feb 2008 20:05:12 +0000 (15:05 -0500)]
lockd: reject reclaims outside the grace period

The current lockd does not reject reclaims that arrive outside of the
grace period.

Accepting a reclaim means promising to the client that no conflicting
locks were granted since last it held the lock.  We can meet that
promise if we assume the only lockers are nfs clients, and that they are
sufficiently well-behaved to reclaim only locks that they held before,
and that only reclaim locks have been permitted so far.  Once we leave
the grace period (and start permitting non-reclaims), we can no longer
keep that promise.  So we must start rejecting reclaims at that point.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: move grace period checks to common code
J. Bruce Fields [Wed, 6 Feb 2008 18:59:23 +0000 (13:59 -0500)]
lockd: move grace period checks to common code

Do all the grace period checks in svclock.c.  This simplifies the code a
bit, and will ease some later changes.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: common grace period control
J. Bruce Fields [Thu, 6 Sep 2007 16:34:25 +0000 (12:34 -0400)]
nfsd: common grace period control

Rewrite grace period code to unify management of grace period across
lockd and nfsd.  The current code has lockd and nfsd cooperate to
compute a grace period which is satisfactory to them both, and then
individually enforce it.  This creates a slight race condition, since
the enforcement is not coordinated.  It's also more complicated than
necessary.

Here instead we have lockd and nfsd each inform common code when they
enter the grace period, and when they're ready to leave the grace
period, and allow normal locking only after both of them are ready to
leave.

We also expect the locks_start_grace()/locks_end_grace() interface here
to be simpler to build on for future cluster/high-availability work,
which may require (for example) putting individual filesystems into
grace, or enforcing grace periods across multiple cluster nodes.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: use nfs client rpc callback program
Benny Halevy [Sun, 28 Sep 2008 06:21:26 +0000 (09:21 +0300)]
nfsd: use nfs client rpc callback program

since commit ff7d9756b501744540be65e172d27ee321d86103
"nfsd: use static memory for callback program and stats"
do_probe_callback uses a static callback program
(NFS4_CALLBACK) rather than the one set in clp->cl_callback.cb_prog
as passed in by the client in setclientid (4.0)
or create_session (4.1).

This patches introduces rpc_create_args.prognumber that allows
overriding program->number when creating rpc_clnt.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: do_probe_callback should not clear rpc stats
Benny Halevy [Fri, 26 Sep 2008 12:14:13 +0000 (15:14 +0300)]
nfsd: do_probe_callback should not clear rpc stats

Now that cb_stats are static (since commit
ff7d9756b501744540be65e172d27ee321d86103)
there's no need to clear them.

Initially I thought it might make sense to do
that every callback probing but since the stats
are per-program and they are shared between possibly
several client callback instances, zeroing them out
seems like the wrong thing to do.

Note that that commit also introduced a bug
since stats.program is also being cleared in the process
and it is not restored after the memset as it used to be.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Clean up debug messages in rpcb_clnt.c
Chuck Lever [Thu, 25 Sep 2008 15:57:05 +0000 (11:57 -0400)]
SUNRPC: Clean up debug messages in rpcb_clnt.c

The RPCB XDR functions are used for multiple procedures.  For instance,
rpcb_encode_getaddr() is used for RPCB_GETADDR, RPCB_SET, and
RPCB_UNSET.  Make the XDR debug messages more generic so they are less
confusing.

And, unlike in other RPC consumers in the kernel, a single debug flag
enables all levels of debug messages in the RPC bind client, including
XDR debug messages.  Since the XDR decoders already report success or
failure in this case, remove redundant debug messages in the mid-level
rpcb_register_call() function.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Fix up svc_unregister()
Chuck Lever [Thu, 25 Sep 2008 15:56:57 +0000 (11:56 -0400)]
SUNRPC: Fix up svc_unregister()

With the new rpcbind code, a PMAP_UNSET will not have any effect on
services registered via rpcbind v3 or v4.

Implement a version of svc_unregister() that uses an RPCB_UNSET with
an empty netid string to make sure we have cleared *all* entries for
a kernel RPC service when shutting down, or before starting a fresh
instance of the service.

Use the new version only when CONFIG_SUNRPC_REGISTER_V4 is enabled;
otherwise, the legacy PMAP version is used to ensure complete
backwards-compatibility with the Linux portmapper daemon.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Use short-hand IPv6 ANYADDR for RPCB_SET
Chuck Lever [Mon, 15 Sep 2008 21:27:30 +0000 (16:27 -0500)]
SUNRPC: Use short-hand IPv6 ANYADDR for RPCB_SET

Clean up: When doing an RPCB_SET, make the kernel's rpcb client use the
shorthand "::" for the universal form of the IPv6 ANY address.

Without this patch, rpcbind will advertise:

  0000:0000:0000:0000:0000:0000:0000:0000.x.y

This is cosmetic only.  It cleans up the display of information from
/sbin/rpcinfo.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Register both netids for AF_INET6 servers
Chuck Lever [Mon, 15 Sep 2008 21:27:23 +0000 (16:27 -0500)]
SUNRPC: Register both netids for AF_INET6 servers

TI-RPC is a user-space library of RPC functions that replaces ONC RPC
and allows RPC to operate in the new world of IPv6.

TI-RPC combines the concept of a transport protocol (UDP and TCP)
and a protocol family (PF_INET and PF_INET6) into a single identifier
called a "netid."  For example, "udp" means UDP over IPv4, and "udp6"
means UDP over IPv6.

For rpcbind, then, the RPC service tuple that is registered and
advertised is:

  [RPC program, RPC version, service address and port, netid]

instead of

  [RPC program, RPC version, port, protocol]

Service address is typically ANYADDR, but can be a specific address
of one of the interfaces on a multi-homed host.  The third item in
the new tuple is expressed as a universal address.

The current Linux rpcbind implementation registers a netid for both
protocol families when RPCB_SET is done for just the PF_INET6 version
of the netid (ie udp6 or tcp6).  So registering "udp6" causes a
registration for "udp" to appear automatically as well.

We've recently determined that this is incorrect behavior.  In the
TI-RPC world, "udp6" is not meant to imply that the registered RPC
service handles requests from AF_INET as well, even if the listener
socket does address mapping.  "udp" and "udp6" are entirely separate
capabilities, and must be registered separately.

The Linux kernel, unlike TI-RPC, leverages address mapping to allow a
single listener socket to handle requests for both AF_INET and AF_INET6.
This is still OK, but the kernel currently assumes registering "udp6"
will cover "udp" as well.  It registers only "udp6" for it's AF_INET6
services, even though they handle both AF_INET and AF_INET6 on the same
port.

So svc_register() actually needs to register both "udp" and "udp6"
explicitly (and likewise for TCP).  Until rpcbind is fixed, the
kernel can ignore the return code for the second RPCB_SET call.

Please merge this with commit 15231312:

    SUNRPC: Support IPv6 when registering kernel RPC services

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Olaf Kirch <okir@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Update nsm_find() to support non-AF_INET addresses
Chuck Lever [Wed, 3 Sep 2008 18:36:23 +0000 (14:36 -0400)]
lockd: Update nsm_find() to support non-AF_INET addresses

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Combine __nsm_find() and nsm_find().
Chuck Lever [Wed, 3 Sep 2008 18:36:16 +0000 (14:36 -0400)]
lockd: Combine __nsm_find() and nsm_find().

Clean up: Having two separate functions doesn't add clarity, so
eliminate one of them.  Use contemporary kernel coding conventions
where appropriate.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Support AF_INET6 when hashing addresses in nlm_lookup_host
Chuck Lever [Wed, 3 Sep 2008 18:36:08 +0000 (14:36 -0400)]
lockd: Support AF_INET6 when hashing addresses in nlm_lookup_host

Adopt an approach similar to the RPC server's auth cache (from Aurelien
Charbon and Brian Haley).

Note nlm_lookup_host()'s existing IP address hash function has the same
issue with correctness on little-endian systems as the original IPv4 auth
cache hash function, so I've also updated it with a hash function similar
to the new auth cache hash function.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Teach nlm_cmp_addr() to support AF_INET6 addresses
Chuck Lever [Wed, 3 Sep 2008 18:36:01 +0000 (14:36 -0400)]
lockd: Teach nlm_cmp_addr() to support AF_INET6 addresses

Update the nlm_cmp_addr() helper to support AF_INET6 as well as AF_INET
addresses.  New version takes two "struct sockaddr *" arguments instead of
"struct sockaddr_in *" arguments.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoNSM: Use sockaddr_storage for sm_addr field
Chuck Lever [Wed, 3 Sep 2008 18:35:54 +0000 (14:35 -0400)]
NSM: Use sockaddr_storage for sm_addr field

To store larger addresses in the nsm_handle structure, make sm_addr a
sockaddr_storage.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Use sockaddr_storage for h_saddr field
Chuck Lever [Wed, 3 Sep 2008 18:35:46 +0000 (14:35 -0400)]
lockd: Use sockaddr_storage for h_saddr field

To store larger addresses in the nlm_host structure, make h_saddr a
sockaddr_storage.  And let's call it something more self-explanatory:
"saddr" could easily be mistaken for "server address".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Use sockaddr_storage + length for h_addr field
Chuck Lever [Wed, 3 Sep 2008 18:35:39 +0000 (14:35 -0400)]
lockd: Use sockaddr_storage + length for h_addr field

To store larger addresses in the nlm_host structure, make h_addr a
sockaddr_storage, and add an address length field.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Make svc_addr's argument a constant
Chuck Lever [Wed, 27 Aug 2008 20:57:46 +0000 (16:57 -0400)]
SUNRPC: Make svc_addr's argument a constant

Clean up: Add extra type safety and squelch a few compiler complaints
in upcoming patches.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Add address family-agnostic helper for zeroing the port number
Chuck Lever [Wed, 27 Aug 2008 20:57:38 +0000 (16:57 -0400)]
lockd: Add address family-agnostic helper for zeroing the port number

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: Specify address family for source address
Chuck Lever [Wed, 27 Aug 2008 20:57:31 +0000 (16:57 -0400)]
lockd: Specify address family for source address

Make sure an address family is specified for source addresses passed to
nlm_lookup_host().  nlm_lookup_host() will need this when it becomes
capable of dealing with AF_INET6 addresses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: address-family independent printable addresses
Chuck Lever [Wed, 27 Aug 2008 20:57:23 +0000 (16:57 -0400)]
lockd: address-family independent printable addresses

Knowing which source address is used for communicating with remote NLM
services can be helpful for debugging configuration problems on hosts
with multiple addresses.

Keep the dprintk debugging here, but adapt it so it displays AF_INET6
addresses properly.  There are also a couple of dprintk clean-ups as
well.

At some point we will aggregate the helpers that display presentation
format addresses into a single set of shared helpers.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoNLM: Clean up before introducing new debugging messages
Chuck Lever [Wed, 27 Aug 2008 20:57:15 +0000 (16:57 -0400)]
NLM: Clean up before introducing new debugging messages

We're about to introduce some extra debugging messages in nlm_lookup_host().
Bring the coding style up to date first so we can cleanly introduce the new
debugging messages.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Support IPv6 when registering kernel RPC services
Chuck Lever [Mon, 18 Aug 2008 23:34:16 +0000 (19:34 -0400)]
SUNRPC: Support IPv6 when registering kernel RPC services

In order to advertise NFS-related services on IPv6 interfaces via
rpcbind, the kernel RPC server implementation must use
rpcb_v4_register() instead of rpcb_register().

A new kernel build option allows distributions to use the legacy
v2 call until they integrate an appropriate user-space rpcbind
daemon that can support IPv6 RPC services.

I tried adding some automatic logic to fall back if registering
with a v4 protocol request failed, but there are too many corner
cases.  So I just made it a compile-time switch that distributions
can throw when they've replaced portmapper with rpcbind.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Split portmap unregister API into separate function
Chuck Lever [Mon, 18 Aug 2008 23:34:08 +0000 (19:34 -0400)]
SUNRPC: Split portmap unregister API into separate function

Create a separate server-level interface for unregistering RPC services.

The mechanics of, and the API for, registering and unregistering RPC
services will diverge further as support for IPv6 is added.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Simplify rpcb_register() API
Chuck Lever [Mon, 18 Aug 2008 23:34:00 +0000 (19:34 -0400)]
SUNRPC: Simplify rpcb_register() API

Bruce suggested there's no need to expose the difference between an error
sending the PMAP_SET request and an error reply from the portmapper to
rpcb_register's callers.  The user space equivalent of rpcb_register() is
pmap_set(3), which returns a bool_t : either the PMAP set worked, or it
didn't.  Simple.

So let's remove the "*okay" argument from rpcb_register() and
rpcb_v4_register(), and simply return an error if any part of the call
didn't work.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Set V6ONLY socket option for RPC listener sockets
Chuck Lever [Mon, 18 Aug 2008 23:33:44 +0000 (19:33 -0400)]
SUNRPC: Set V6ONLY socket option for RPC listener sockets

My plan is to use an AF_INET listener on systems that support only IPv4,
and an AF_INET6 listener on systems that can support IPv6. Incoming
IPv4 packets will be posted to an AF_INET6 listener with a mapped IPv4
address.

Max Matveev <makc@sgi.com> says:
  Creating a single listener can be dangerous - if net.ipv6.bindv6only
  is enabled then it's possible to create another listener in v4
  namespace on the same port and steal the traffic from the "unifed"
  listener. You need to disable V6ONLY explicitly via a sockopt to stop
  that.

Set appropriate socket option on RPC server listener sockets to prevent
this.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agolockd: don't depend on lockd main loop to end grace
J. Bruce Fields [Tue, 18 Mar 2008 23:00:19 +0000 (19:00 -0400)]
lockd: don't depend on lockd main loop to end grace

End lockd's grace period using schedule_delayed_work() instead of a
check on every pass through the main loop.

After a later patch, we'll depend on lockd to end its grace period even
if it's not currently handling requests; so it shouldn't depend on being
woken up from the main loop to do so.

Also, Nakano Hiroaki (who independently produced a similar patch)
noticed that the current behavior is buggy in the face of jiffies
wraparound:

"lockd uses time_before() to determine whether the grace period
has expired. This would seem to be enough to avoid timer
wrap-around issues, but, unfortunately, that is not the case.
The time_* family of comparison functions can be safely used to
compare jiffies relatively close in time, but they stop working
after approximately LONG_MAX/2 ticks. nfsd can suffer this
problem because the time_before() comparison in lockd() is not
performed until the first request comes in, which means that if
there is no lockd traffic for more than LONG_MAX/2 ticks we are
screwed.

"The implication of this is that once time_before() starts
misbehaving any attempt from a NFS client to execute fcntl()
will be received with a NLM_LCK_DENIED_GRACE_PERIOD message for
25 days (assuming HZ=1000). In other words, the 50 seconds grace
period could turn into a grace period of 50 days or more.

"Note: This bug was analyzed independently by Oda-san
<oda@valinux.co.jp> and myself."

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Nakano Hiroaki <nakano.hiroaki@oss.ntt.co.jp>
Cc: Itsuro Oda <oda@valinux.co.jp>
15 years agolocks: allow lockd to process blocked locks during grace period
J. Bruce Fields [Thu, 24 Jan 2008 16:11:34 +0000 (11:11 -0500)]
locks: allow lockd to process blocked locks during grace period

The check here is currently harmless but unnecessary, since, as the
comment notes, there aren't any blocked-lock callbacks to process
during the grace period anyway.

And eventually we want to allow multiple grace periods that come and go
for different filesystems over the course of the lifetime of lockd, at
which point this check is just going to get in the way.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoknfsd: allocate readahead cache in individual chunks
Jeff Layton [Thu, 14 Aug 2008 02:03:27 +0000 (22:03 -0400)]
knfsd: allocate readahead cache in individual chunks

I had a report from someone building a large NFS server that they were
unable to start more than 585 nfsd threads. It was reported against an
older kernel using the slab allocator, and I tracked it down to the
large allocation in nfsd_racache_init failing.

It appears that the slub allocator handles large allocations better,
but large contiguous allocations can often be problematic. There
doesn't seem to be any reason that the racache has to be allocated as a
single large chunk. This patch breaks this up so that the racache is
built up from separate allocations.

(Thanks also to Takashi Iwai for a bugfix.)

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Takashi Iwai <tiwai@suse.de>
15 years agonfsd: nfs4xdr decode_stateid helper function
Benny Halevy [Tue, 12 Aug 2008 17:46:18 +0000 (20:46 +0300)]
nfsd: nfs4xdr decode_stateid helper function

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: properly xdr-decode NFS4_OPEN_CLAIM_DELEGATE_CUR stateid
Benny Halevy [Tue, 12 Aug 2008 17:45:51 +0000 (20:45 +0300)]
nfsd: properly xdr-decode NFS4_OPEN_CLAIM_DELEGATE_CUR stateid

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: don't declare p in ENCODE_SEQID_OP_HEAD
Benny Halevy [Tue, 12 Aug 2008 17:45:28 +0000 (20:45 +0300)]
nfsd: don't declare p in ENCODE_SEQID_OP_HEAD

After using the encode_stateid helper the "p" pointer declared
by ENCODE_SEQID_OP_HEAD is warned as unused.
In the single site where it is still needed it can be declared
separately using the ENCODE_HEAD macro.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: nfs4xdr encode_stateid helper function
Benny Halevy [Tue, 12 Aug 2008 17:45:07 +0000 (20:45 +0300)]
nfsd: nfs4xdr encode_stateid helper function

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: fix nfsd4_encode_open buffer space reservation
Benny Halevy [Tue, 12 Aug 2008 17:44:41 +0000 (20:44 +0300)]
nfsd: fix nfsd4_encode_open buffer space reservation

nfsd4_encode_open first reservation is currently for 36 + sizeof(stateid_t)
while it writes after the stateid a cinfo (20 bytes) and 5 more 4-bytes
words, for a total of 40 + sizeof(stateid_t).

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: properly xdr-encode deleg stateid returned from open
Benny Halevy [Tue, 12 Aug 2008 17:43:37 +0000 (20:43 +0300)]
nfsd: properly xdr-encode deleg stateid returned from open

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: properly xdr-encode stateid4.seqid as uint32_t for cb_recall
Benny Halevy [Tue, 12 Aug 2008 17:42:51 +0000 (20:42 +0300)]
nfsd: properly xdr-encode stateid4.seqid as uint32_t for cb_recall

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoConfigure out file locking features
Thomas Petazzoni [Wed, 6 Aug 2008 13:12:22 +0000 (15:12 +0200)]
Configure out file locking features

This patch adds the CONFIG_FILE_LOCKING option which allows to remove
support for advisory locks. With this patch enabled, the flock()
system call, the F_GETLK, F_SETLK and F_SETLKW operations of fcntl()
and NFS support are disabled. These features are not necessarly needed
on embedded systems. It allows to save ~11 Kb of kernel code and data:

   text          data     bss     dec     hex filename
1125436        118764  212992 1457192  163c28 vmlinux.old
1114299        118564  212992 1445855  160fdf vmlinux
 -11137    -200       0  -11337   -2C49 +/-

This patch has originally been written by Matt Mackall
<mpm@selenic.com>, and is part of the Linux Tiny project.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: matthew@wil.cx
Cc: linux-fsdevel@vger.kernel.org
Cc: mpm@selenic.com
Cc: akpm@linux-foundation.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agonfsd: permit unauthenticated stat of export root
J. Bruce Fields [Thu, 7 Aug 2008 17:00:20 +0000 (13:00 -0400)]
nfsd: permit unauthenticated stat of export root

RFC 2623 section 2.3.2 permits the server to bypass gss authentication
checks for certain operations that a client may perform when mounting.
In the case of a client that doesn't have some form of credentials
available to it on boot, this allows it to perform the mount unattended.
(Presumably real file access won't be needed until a user with
credentials logs in.)

Being slightly more lenient allows lots of old clients to access
krb5-only exports, with the only loss being a small amount of
information leaked about the root directory of the export.

This affects only v2 and v3; v4 still requires authentication for all
access.

Thanks to Peter Staubach testing against a Solaris client, which
suggesting addition of v3 getattr, to the list, and to Trond for noting
that doing so exposes no additional information.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Peter Staubach <staubach@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
15 years agoSUNRPC: Use proper INADDR_ANY when setting up RPC services on IPv6
Chuck Lever [Mon, 30 Jun 2008 22:45:37 +0000 (18:45 -0400)]
SUNRPC: Use proper INADDR_ANY when setting up RPC services on IPv6

Teach svc_create_xprt() to use the correct ANY address for AF_INET6 based
RPC services.

No caller uses AF_INET6 yet.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoSUNRPC: Add address family field to svc_serv data structure
Chuck Lever [Mon, 30 Jun 2008 22:45:30 +0000 (18:45 -0400)]
SUNRPC: Add address family field to svc_serv data structure

Introduce and initialize an address family field in the svc_serv structure.

This field will determine what family to use for the service's listener
sockets and what families are advertised via the local rpcbind daemon.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
15 years agoLinux 2.6.27-rc7 v2.6.27-rc7
Linus Torvalds [Sun, 21 Sep 2008 22:29:55 +0000 (15:29 -0700)]
Linux 2.6.27-rc7

15 years agoMerge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
Linus Torvalds [Sun, 21 Sep 2008 19:41:19 +0000 (12:41 -0700)]
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon: (ad7414) Make ad7414_update_device() static
  hwmon: (it87) Fix fan tachometer reading in IT8712F rev 0x7 (I)
  hwmon: (atxp1) Fix device detection logic

15 years agoMerge branch 'kvm-updates/2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 21 Sep 2008 19:40:56 +0000 (12:40 -0700)]
Merge branch 'kvm-updates/2.6.27' of git://git./linux/kernel/git/avi/kvm

* 'kvm-updates/2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: ia64: 'struct fdesc' build fix

15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Sun, 21 Sep 2008 19:40:30 +0000 (12:40 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] vmlinux.lds.S: handle .text.*
  [MIPS] Fix potential latency problem due to non-atomic cpu_wait.
  [MIPS] SMTC: Clear TIF_FPUBOUND on clone / fork.
  [MIPS] Fix 64-bit IP checksum code

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Sun, 21 Sep 2008 19:38:45 +0000 (12:38 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc_test: initialize mmc_test_lock statically
  mmc_block: handle error from mmc_register_driver()
  atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin
  atmel-mci: Fix bogus debugfs file size
  atmel-mci: Fix memory leak in atmci_regs_show
  atmel-mci: debugfs: enable clock before dumping regs
  tmio_mmc: fix compilation with debug enabled

15 years agoMAINTAINERS: Various fixes
Jean Delvare [Sat, 20 Sep 2008 10:34:33 +0000 (12:34 +0200)]
MAINTAINERS: Various fixes

* Normalize some S: entries to match the enumeration at the beginning
  of the file.
* Change one mailing list entry from S: to L:.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMAINTAINERS: Trivial whitespace cleanups
Jean Delvare [Sat, 20 Sep 2008 10:33:08 +0000 (12:33 +0200)]
MAINTAINERS: Trivial whitespace cleanups

* Drop trailing whitespace.
* Replace spaces and combinations of spaces and tabs by single tabs.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[MIPS] vmlinux.lds.S: handle .text.*
Atsushi Nemoto [Tue, 5 Aug 2008 14:45:14 +0000 (23:45 +0900)]
[MIPS] vmlinux.lds.S: handle .text.*

The -ffunction-sections puts each text in .text.function_name section.
Without this patch, most functions are placed outside _text..._etext
area and it breaks show_stacktrace(), etc.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Atsushi Nemoto [Sun, 11 Nov 2007 17:05:18 +0000 (02:05 +0900)]
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.

If an interrupt happened between checking of NEED_RESCHED and WAIT
instruction, adjust EPC to restart from checking of NEED_RESCHED.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] SMTC: Clear TIF_FPUBOUND on clone / fork.
Ralf Baechle [Tue, 9 Sep 2008 13:19:10 +0000 (15:19 +0200)]
[MIPS] SMTC: Clear TIF_FPUBOUND on clone / fork.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[MIPS] Fix 64-bit IP checksum code
Atsushi Nemoto [Sat, 20 Sep 2008 15:20:04 +0000 (17:20 +0200)]
[MIPS] Fix 64-bit IP checksum code

Use unsigned loads to avoid possible misscalculation of IP checksums.  This
bug was instruced in f761106cd728bcf65b7fe161b10221ee00cf7132 (lmo) /
ed99e2bc1dc5dc54eb5a019f4975562dbef20103 (kernel.org).

[Original fix by Atsushi.  Improved instruction scheduling and fix for
unaligned unsigned load by me -- Ralf]

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agommc_test: initialize mmc_test_lock statically
Akinobu Mita [Sat, 13 Sep 2008 10:03:32 +0000 (19:03 +0900)]
mmc_test: initialize mmc_test_lock statically

The mutex mmc_test_lock is initialized at every time mmc_test device
is probed. Probing another mmc_test device may break the mutex, if
the probe function is called while the mutex is locked.

This patch fixes it by statically initializing mmc_test_lock.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agommc_block: handle error from mmc_register_driver()
Akinobu Mita [Sat, 13 Sep 2008 10:02:07 +0000 (19:02 +0900)]
mmc_block: handle error from mmc_register_driver()

Check error from mmc_register_driver() and properly unwind
block device registration.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agoatmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin
Haavard Skinnemoen [Fri, 19 Sep 2008 19:09:30 +0000 (21:09 +0200)]
atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin

This allows the mmc core to detect card insertion/removal for slots that
don't have any CD pin wired up.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agoatmel-mci: Fix bogus debugfs file size
Haavard Skinnemoen [Fri, 19 Sep 2008 19:09:29 +0000 (21:09 +0200)]
atmel-mci: Fix bogus debugfs file size

We used to store a binary register snapshot in the "regs" file, so we
set the file size to be the size of this snapshot. This is no longer
valid since we switched to using seq_file.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agoatmel-mci: Fix memory leak in atmci_regs_show
Haavard Skinnemoen [Fri, 19 Sep 2008 19:09:28 +0000 (21:09 +0200)]
atmel-mci: Fix memory leak in atmci_regs_show

The debugfs hook atmci_regs_show allocates a temporary buffer for
storing a register snapshot, but it doesn't free it before returning.
Plug this leak.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agoatmel-mci: debugfs: enable clock before dumping regs
Haavard Skinnemoen [Fri, 19 Sep 2008 19:09:27 +0000 (21:09 +0200)]
atmel-mci: debugfs: enable clock before dumping regs

Make sure that the peripheral clock is enabled before reading the MMIO
registers for the debugfs "regs" dump.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agotmio_mmc: fix compilation with debug enabled
Dmitry Baryshkov [Wed, 3 Sep 2008 15:33:30 +0000 (19:33 +0400)]
tmio_mmc: fix compilation with debug enabled

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
15 years agohwmon: (ad7414) Make ad7414_update_device() static
Adrian Bunk [Sat, 20 Sep 2008 08:25:20 +0000 (10:25 +0200)]
hwmon: (ad7414) Make ad7414_update_device() static

This patch makes the needlessly global ad7414_update_device() static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agohwmon: (it87) Fix fan tachometer reading in IT8712F rev 0x7 (I)
Andrew Paprocki [Sat, 20 Sep 2008 08:25:19 +0000 (10:25 +0200)]
hwmon: (it87) Fix fan tachometer reading in IT8712F rev 0x7 (I)

The IT8712F v0.9.1 datasheet applies to revisions >= 0x8 (J).
The driver was incorrectly attempting to enable 16-bit fan
readings on rev 0x7 (I) which led to incorrect RPM values.

Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Tested-by: John Gumb <john.gumb@tandberg.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15 years agohwmon: (atxp1) Fix device detection logic
Jean Delvare [Sat, 20 Sep 2008 08:25:19 +0000 (10:25 +0200)]
hwmon: (atxp1) Fix device detection logic

The atxp1 device detection code has a major logic flaw, fix it. Not
sure how we managed to miss this when the driver was merged...

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Sebastian Witt <se.witt@gmx.net>
15 years agoKVM: ia64: 'struct fdesc' build fix
Jes Sorensen [Fri, 12 Sep 2008 12:12:08 +0000 (14:12 +0200)]
KVM: ia64: 'struct fdesc' build fix

Commit 4611a77 ("[IA64] fix compile failure with non modular builds")
introduced struct fdesc into asm/elf.h, which duplicates KVM's definition.
Remove the latter to avoid the build error.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
15 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Fri, 19 Sep 2008 23:24:03 +0000 (16:24 -0700)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] cio: fix orb initialization in cio_start_key
  [S390] cio: Fix driver_data handling for ccwgroup devices.

15 years agoMerge git://oss.sgi.com:8090/xfs/linux-2.6
Linus Torvalds [Fri, 19 Sep 2008 23:21:59 +0000 (16:21 -0700)]
Merge git://oss.sgi.com:8090/xfs/linux-2.6

* git://oss.sgi.com:8090/xfs/linux-2.6:
  [XFS] Don't do I/O beyond eof when unreserving space
  [XFS] Fix use-after-free with buffers
  [XFS] Prevent lockdep false positives when locking two inodes.
  [XFS] Fix barrier status change detection.
  [XFS] Prevent direct I/O from mapping extents beyond eof
  [XFS] Fix regression introduced by remount fixup
  [XFS] Move memory allocations for log tracing out of the critical path

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Fri, 19 Sep 2008 23:18:21 +0000 (16:18 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop()
  RDMA/nes: Fix client side QP destroy
  IB/mlx4: Fix up fast register page list format
  mlx4_core: Set RAE and init mtt_sz field in FRMR MPT entries

15 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 19 Sep 2008 23:17:12 +0000 (16:17 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: fix deadlock in setting scheduler parameter to zero
  sched: fix 2.6.27-rc5 couldn't boot on tulsa machine randomly

15 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 19 Sep 2008 23:16:50 +0000 (16:16 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clockevents: make device shutdown robust
  clocksource, acpi_pm.c: fix check for monotonicity
  clockevents: remove WARN_ON which was used to gather information

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 19 Sep 2008 23:11:09 +0000 (16:11 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: completely disable NOPL on 32 bits
  x86/paravirt: Remove duplicate paravirt_pagetable_setup_{start, done}()
  xen: fix for xen guest with mem > 3.7G
  x86: fix possible x86_64 and EFI regression
  arch/x86/kernel/kdebugfs.c: introduce missing kfree

15 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Fri, 19 Sep 2008 23:05:05 +0000 (16:05 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  Fix compile failure with non modular builds
  powerpc: Holly board needs dtbImage target
  powerpc: Fix interrupt values for DMA2 in MPC8610 HPCD device tree

15 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Fri, 19 Sep 2008 23:04:42 +0000 (16:04 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 5255/1: Update jornada ssp to remove build errors/warnings
  [ARM] omap: back out 'internal_clock' support
  [ARM] 5249/1: davinci: remove redundant check in davinci_psc_config()

15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen...
Linus Torvalds [Fri, 19 Sep 2008 23:03:38 +0000 (16:03 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/hskinnemoen/avr32-2.6

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: nmi_enter() without nmi_exit()
  avr32: fix sys_sync_file_range() call convention
  avr32: add generic_find_next_le_bit bit function
  avr32: add .gitignore files
  atstk1000: fix build breakage with BOARD_ATSTK100X_SW2_CUSTOM=y

15 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Fri, 19 Sep 2008 23:02:52 +0000 (16:02 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: Don't wait UNINTERRUPTIBLE for other resync to finish

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Fri, 19 Sep 2008 23:02:05 +0000 (16:02 -0700)]
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix SMP bootup with CONFIG_STACK_DEBUG or ftrace.
  sparc64: Fix OOPS in psycho_pcierr_intr_other().

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 19 Sep 2008 23:01:37 +0000 (16:01 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  e100: Use pci_pme_active to clear PME_Status and disable PME#
  e1000: prevent corruption of EEPROM/NVM
  forcedeth: call restore mac addr in nv_shutdown path
  bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int
  sctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH
  sctp: do not enable peer features if we can't do them.
  sctp: set the skb->ip_summed correctly when sending over loopback.
  udp: Fix rcv socket locking

15 years agoavr32: nmi_enter() without nmi_exit()
Manfred Spraul [Wed, 20 Aug 2008 13:39:59 +0000 (15:39 +0200)]
avr32: nmi_enter() without nmi_exit()

While updating the rcu code, I noticed that do_nmi() for AVR32 is odd:
There is an nmi_enter() call without an nmi_exit().
This can't be correct, it breaks rcu (at least the preempt version) and
lockdep.

[haavard.skinnemoen@atmel.com: fixed another case that returned directly]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
15 years agoavr32: fix sys_sync_file_range() call convention
Hans-Christian Egtvedt [Wed, 17 Sep 2008 11:39:45 +0000 (13:39 +0200)]
avr32: fix sys_sync_file_range() call convention

On AVR32, all parameters beyond the 5th are passed on the stack. System
calls don't use the stack -- they borrow a callee-saved register
instead. This means that syscalls that take 6 parameters must be called
through a stub that pushes the last parameter on the stack.

This patch adds a stub for sync_file_range syscall on AVR32
architecture.  Tested with uClibc snapshot.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
15 years agoavr32: add generic_find_next_le_bit bit function
Hans-Christian Egtvedt [Wed, 10 Sep 2008 13:52:04 +0000 (15:52 +0200)]
avr32: add generic_find_next_le_bit bit function

This patch implements the generic_find_next_le_bit bit function for AVR32
architecture. This is used by EXT4 file system.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
15 years agoavr32: add .gitignore files
Markus Heidelberg [Sun, 7 Sep 2008 22:22:45 +0000 (00:22 +0200)]
avr32: add .gitignore files

Ignore Kernel binaries, kernel/vmlinux.lds and a log file.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
15 years agoatstk1000: fix build breakage with BOARD_ATSTK100X_SW2_CUSTOM=y
Haavard Skinnemoen [Fri, 19 Sep 2008 15:56:54 +0000 (17:56 +0200)]
atstk1000: fix build breakage with BOARD_ATSTK100X_SW2_CUSTOM=y

The #ifdef surrounding the code adding the mmc controller had a typo,
causing it to be compiled even when mmc was supposed to be disabled.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
15 years agomd: Don't wait UNINTERRUPTIBLE for other resync to finish
NeilBrown [Fri, 19 Sep 2008 01:49:54 +0000 (11:49 +1000)]
md: Don't wait UNINTERRUPTIBLE for other resync to finish

When two md arrays share some block device (e.g each uses different
partitions on the one device), a resync of one array will wait for
the resync on the other to finish.

This can be a long time and as it currently waits TASK_UNINTERRUPTIBLE,
the softlockup code notices and complains.

So use TASK_INTERRUPTIBLE instead and make sure to flush signals
before calling schedule.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoe100: Use pci_pme_active to clear PME_Status and disable PME#
Rafael J. Wysocki [Thu, 7 Aug 2008 22:18:04 +0000 (00:18 +0200)]
e100: Use pci_pme_active to clear PME_Status and disable PME#

Currently e100 uses pci_enable_wake() to clear pending wake-up events
and disable PME# during intitialization, but that function is not
suitable for this purpose, because it immediately returns error code
if device_may_wakeup() returns false for given device.

Make e100 use pci_pme_active(), which carries out exactly the
required operations, instead.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoe1000: prevent corruption of EEPROM/NVM
Christopher Li [Fri, 5 Sep 2008 21:04:05 +0000 (14:04 -0700)]
e1000: prevent corruption of EEPROM/NVM

Andrey reports e1000 corruption, and that a patch in vmware's ESX fixed
it.

The EEPROM corruption is triggered by concurrent access of the EEPROM
read/write. Putting a lock around it solve the problem.

[akpm@linux-foundation.org: use DEFINE_SPINLOCK to avoid confusing lockdep]
Signed-off-by: Christopher Li <chrisl@vmware.com>
Reported-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Zach Amsden <zach@vmware.com>
Cc: Pratap Subrahmanyam <pratap@vmware.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoforcedeth: call restore mac addr in nv_shutdown path
Yinghai Lu [Sat, 13 Sep 2008 20:10:31 +0000 (13:10 -0700)]
forcedeth: call restore mac addr in nv_shutdown path

after

| commit f735a2a1a4f2a0f5cd823ce323e82675990469e2
| Author: Tobias Diedrich <ranma+kernel@tdiedrich.de>
| Date:   Sun May 18 15:02:37 2008 +0200
|
|    [netdrvr] forcedeth: setup wake-on-lan before shutting down
|
|    When hibernating in 'shutdown' mode, after saving the image the suspend hook
|    is not called again.
|    However, if the device is in promiscous mode, wake-on-lan will not work.
|    This adds a shutdown hook to setup wake-on-lan before the final shutdown.
|
|    Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
|    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

my servers with nvidia ck804 and mcp55 will reverse mac address with kexec.

it turns out that we need to restore the mac addr in nv_shutdown().

[akpm@linux-foundation.org: fix typo in printk]
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agobnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int
Benjamin Li [Thu, 18 Sep 2008 23:46:11 +0000 (16:46 -0700)]
bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int

The bnx2 driver stores/uses the irq value from the pci_dev internally.
But when it stores the irq value, it has been performing an
integer demotion.  Because of the recent changes made to
arch/x86/kernel/io_apic.c, the new method in creating the irq value
(using build_irq_for_pci_dev()) has exposed this bug on x86 systems.

Because of this demotion when calling request_irq() from
bnx2_request_irq(), the driver would get a return code of -EINVAL.
This is because the kernel could not find the requested irq descriptor.
By storing the irq value properly, the kernel can find the correct
irq descriptor and the bnx2 driver can operate normally.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH
Vlad Yasevich [Thu, 18 Sep 2008 23:28:27 +0000 (16:28 -0700)]
sctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH

If INIT-ACK is received with SupportedExtensions parameter which
indicates that the peer does not support AUTH, the packet will be
silently ignore, and sctp_process_init() do cleanup all of the
transports in the association.
When T1-Init timer is expires, OOPS happen while we try to choose
a different init transport.

The solution is to only clean up the non-active transports, i.e
the ones that the peer added.  However, that introduces a problem
with sctp_connectx(), because we don't mark the proper state for
the transports provided by the user.  So, we'll simply mark
user-provided transports as ACTIVE.  That will allow INIT
retransmissions to work properly in the sctp_connectx() context
and prevent the crash.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: do not enable peer features if we can't do them.
Vlad Yasevich [Thu, 18 Sep 2008 23:27:38 +0000 (16:27 -0700)]
sctp: do not enable peer features if we can't do them.

Do not enable peer features like addip and auth, if they
are administratively disabled localy.  If the peer resports
that he supports something that we don't, neither end can
use it so enabling it is pointless.  This solves a problem
when talking to a peer that has auth and addip enabled while
we do not.  Found by Andrei Pelinescu-Onciul <andrei@iptel.org>.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago[ARM] 5255/1: Update jornada ssp to remove build errors/warnings
Kristoffer Ericson [Thu, 18 Sep 2008 11:19:39 +0000 (12:19 +0100)]
[ARM] 5255/1: Update jornada ssp to remove build errors/warnings

* Adds ssp functions into header so we don't get
"implicit declaration" error at builtime.
* Converts jornada_ssp_start/end functions into voids with
proper declarations (to avoid "prototype..." warning).
* Sorts include files in alphabetical order
* Minor comment changes

Signed-off-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agosctp: set the skb->ip_summed correctly when sending over loopback.
Vlad Yasevich [Thu, 18 Sep 2008 09:48:25 +0000 (02:48 -0700)]
sctp: set the skb->ip_summed correctly when sending over loopback.

Loopback used to clobber the ip_summed filed which sctp then used
to figure out if it needed to do checksumming or not.  Now that
loopback doesn't do that any more, sctp needs to set the ip_summed
field correctly.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago[ARM] omap: back out 'internal_clock' support
Russell King [Wed, 17 Sep 2008 19:58:11 +0000 (20:58 +0100)]
[ARM] omap: back out 'internal_clock' support

The structures weren't ready for this change:

arch/arm/plat-omap/devices.c:320: error: 'struct omap_mmc_conf' has no member named 'internal_clock'
arch/arm/plat-omap/devices.c:326: error: implicit declaration of function 'omap_ctrl_readl'
arch/arm/plat-omap/devices.c:326: error: 'OMAP2_CONTROL_DEVCONF0' undeclared (first use in this function)
arch/arm/plat-omap/devices.c:328: error: implicit declaration of function 'omap_ctrl_writel'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years ago[ARM] 5249/1: davinci: remove redundant check in davinci_psc_config()
roelkluin [Mon, 15 Sep 2008 19:56:44 +0000 (20:56 +0100)]
[ARM] 5249/1: davinci: remove redundant check in davinci_psc_config()

id is unsigned, check is redundant.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoFix compile failure with non modular builds
James Bottomley [Tue, 9 Sep 2008 14:04:18 +0000 (14:04 +0000)]
Fix compile failure with non modular builds

Commit deac93df26b20cf8438339b5935b5f5643bc30c9 ("lib: Correct printk
%pF to work on all architectures") broke the non modular builds by
moving an essential function into modules.c.  Fix this by moving it
out again and into asm/sections.h as an inline.  To do this, the
definition of struct ppc64_opd_entry has been lifted out of modules.c
and put in asm/elf.h where it belongs.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc: Holly board needs dtbImage target
Josh Boyer [Tue, 9 Sep 2008 04:00:28 +0000 (04:00 +0000)]
powerpc: Holly board needs dtbImage target

One of the changes in the bootwrapper makefile introduced the dtbImage
targets for boards that need a simple zImage with a DTB embedded in
them (595be948cce574ff2d5dde5d0426a636a4363c70, "[POWERPC]
bootwrapper: Build multiple cuImages").  When this was done, it broke
booting on the Holly board as the zImage.holly wrapper did not get the
DTB embedded properly.

This changes the target for the Holly board to a dtbImage so that the
wrapper includes the vmlinux, wrapper bits, and DTB.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years ago[XFS] Don't do I/O beyond eof when unreserving space
Lachlan McIlroy [Wed, 17 Sep 2008 06:52:50 +0000 (16:52 +1000)]
[XFS] Don't do I/O beyond eof when unreserving space

When unreserving space with boundaries that are not block aligned we round
up the start and round down the end boundaries and then use this function,
xfs_zero_remaining_bytes(), to zero the parts of the blocks that got
dropped during the rounding. The problem is we don't consider if these
blocks are beyond eof. Worse still is if we encounter delayed allocations
beyond eof we will try to use the magic delayed allocation block number as
a real block number. If the file size is ever extended to expose these
blocks then we'll go through xfs_zero_eof() to zero them anyway.

SGI-PV: 983683

SGI-Modid: xfs-linux-melb:xfs-kern:32055a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
15 years ago[XFS] Fix use-after-free with buffers
Lachlan McIlroy [Wed, 17 Sep 2008 06:52:13 +0000 (16:52 +1000)]
[XFS] Fix use-after-free with buffers

We have a use-after-free issue where log completions access buffers via
the buffer log item and the buffer has already been freed. Fix this by
taking a reference on the buffer when attaching the buffer log item and
release the hold when the buffer log item is detached and we no longer
need the buffer. Also create a new function xfs_buf_item_free() to combine
some common code.

SGI-PV: 985757

SGI-Modid: xfs-linux-melb:xfs-kern:32025a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
15 years ago[XFS] Prevent lockdep false positives when locking two inodes.
David Chinner [Wed, 17 Sep 2008 06:51:21 +0000 (16:51 +1000)]
[XFS] Prevent lockdep false positives when locking two inodes.

If we call xfs_lock_two_inodes() to grab both the iolock and the ilock,
then drop the ilocks on both inodes, then grab them again (as
xfs_swap_extents() does) then lockdep will report a locking order problem.
This is a false positive.

To avoid this, disallow xfs_lock_two_inodes() fom locking both inode locks
at once - force calers to make two separate calls. This means that nested
dropping and regaining of the ilocks will retain the same lockdep subclass
and so lockdep will not see anything wrong with this code.

SGI-PV: 986238

SGI-Modid: xfs-linux-melb:xfs-kern:31999a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Peter Leckie <pleckie@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>