safe/jmp/linux-2.6
15 years ago[XFS] Fix compile with CONFIG_COMPAT enabled
Christoph Hellwig [Thu, 4 Dec 2008 13:23:27 +0000 (14:23 +0100)]
[XFS] Fix compile with CONFIG_COMPAT enabled

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years agomove inode tracing out of xfs_vnode.
Christoph Hellwig [Wed, 3 Dec 2008 11:20:40 +0000 (12:20 +0100)]
move inode tracing out of xfs_vnode.

Move the inode tracing into xfs_iget.c / xfs_inode.h and kill xfs_vnode.c
now that it's empty.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agomove vn_iowait / vn_iowake into xfs_aops.c
Christoph Hellwig [Wed, 3 Dec 2008 11:20:39 +0000 (12:20 +0100)]
move vn_iowait / vn_iowake into xfs_aops.c

The whole machinery to wait on I/O completion is related to the I/O path
and should be there instead of in xfs_vnode.c.  Also give the functions
more descriptive names.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agokill vn_ioerror
Christoph Hellwig [Wed, 3 Dec 2008 11:20:38 +0000 (12:20 +0100)]
kill vn_ioerror

There's just one caller of this helper, and it's much cleaner to just merge
the xfs_do_force_shutdown call into it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agokill xfs_unmount_flush
Christoph Hellwig [Wed, 3 Dec 2008 11:20:37 +0000 (12:20 +0100)]
kill xfs_unmount_flush

There's almost nothing left in this function, instead remove the IRELE
on the real times inodes and the call to XFS_QM_UNMOUNT into xfs_unmountfs.

For the regular unmount case that means it now also happenes after dmapi
notification, but otherwise there is no difference in behaviour.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agono explicit xfs_iflush for special inodes during unmount
Christoph Hellwig [Wed, 3 Dec 2008 11:20:36 +0000 (12:20 +0100)]
no explicit xfs_iflush for special inodes during unmount

Currently we explicitly call xfs_iflush on the quota, real-time and root
inodes from xfs_unmount_flush.  But we just called xfs_sync_inodes with
SYNC_ATTR and do an XFS_bflush aka xfs_flush_buftarg to make sure all inodes
are on disk already, so there is no need for these special cases.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agouse xfs_trans_ijoin in xfs_trans_iget
Christoph Hellwig [Wed, 3 Dec 2008 11:20:35 +0000 (12:20 +0100)]
use xfs_trans_ijoin in xfs_trans_iget

Use xfs_trans_ijoin in xfs_trans_iget in case we need to join an inode into
a transaction instead of opencoding it.  Based on a discussion with and an
incomplete patch from Niv Sardi.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove leftovers of shared read-only support
Christoph Hellwig [Wed, 3 Dec 2008 11:20:34 +0000 (12:20 +0100)]
remove leftovers of shared read-only support

We never supported shared read-only filesystems, so remove the dead
code left over from IRIX for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove unused m_inode_quiesce member from struct xfs_mount
Christoph Hellwig [Wed, 3 Dec 2008 11:20:33 +0000 (12:20 +0100)]
remove unused m_inode_quiesce member from struct xfs_mount

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agokill dead inode flags
Christoph Hellwig [Wed, 3 Dec 2008 11:20:32 +0000 (12:20 +0100)]
kill dead inode flags

There are a few inode flags around that aren't used anywhere, so remove
them.  Also update xfsidbg to display all used inode flags correctly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agocleanup xfs_sb.h feature flag helpers
Christoph Hellwig [Wed, 3 Dec 2008 11:20:31 +0000 (12:20 +0100)]
cleanup xfs_sb.h feature flag helpers

The various inlines in xfs_sb.h that deal with the superblock version
and fature flags were converted from macros a while ago, and this
show by the odd coding style full of useless braces and backslashes
and the avoidance of conditionals.

Clean these up to look like normal C code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agokill dead quota flags
Christoph Hellwig [Wed, 3 Dec 2008 11:20:30 +0000 (12:20 +0100)]
kill dead quota flags

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove dead code from sv_t implementation
Christoph Hellwig [Wed, 3 Dec 2008 11:20:29 +0000 (12:20 +0100)]
remove dead code from sv_t implementation

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoreduce l_icloglock roundtrips
Christoph Hellwig [Wed, 3 Dec 2008 11:20:28 +0000 (12:20 +0100)]
reduce l_icloglock roundtrips

All but one caller of xlog_state_want_sync drop and re-acquire
l_icloglock around the call to it, just so that xlog_state_want_sync can
acquire and drop it.

Move all lock operation out of l_icloglock and assert that the lock is
held when it is called.

Note that it would make sense to extende this scheme to
xlog_state_release_iclog, but the locking in there is more complicated
and we'd like to keep the atomic_dec_and_lock optmization for those
callers not having l_icloglock yet.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agostop using igrab in xfs_vn_link
Christoph Hellwig [Wed, 3 Dec 2008 11:20:27 +0000 (12:20 +0100)]
stop using igrab in xfs_vn_link

->link is guranteed to get an already reference inode passed so we
can do a simple increment of i_count instead of using igrab and thus
avoid banging on the global inode_lock.  This is what most filesystems
already do.

Also move the increment after the call to xfs_link to simplify error
handling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agokill xfs_buf_iostart
Christoph Hellwig [Wed, 3 Dec 2008 11:20:26 +0000 (12:20 +0100)]
kill xfs_buf_iostart

xfs_buf_iostart is a "shared" helper for xfs_buf_read_flags,
xfs_bawrite, and xfs_bdwrite - except that there isn't much shared
code but rather special cases for each caller.

So remove this function and move the functionality to the caller.
xfs_bawrite and xfs_bdwrite are now big enough to be moved out of
line and the xfs_buf_read_flags is moved into a new helper called
_xfs_buf_read.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agocleanup the inode reclaim path
Christoph Hellwig [Wed, 3 Dec 2008 11:20:25 +0000 (12:20 +0100)]
cleanup the inode reclaim path

Merge xfs_iextract and xfs_idestroy into xfs_ireclaim as they are never
called individually.  Also rewrite most comments in this area as they
were severly out of date.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove unused prototypes for xfs_ihash_init / xfs_ihash_free
Christoph Hellwig [Wed, 3 Dec 2008 11:20:24 +0000 (12:20 +0100)]
remove unused prototypes for xfs_ihash_init / xfs_ihash_free

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove unused behvavior cruft in xfs_super.h
Christoph Hellwig [Wed, 3 Dec 2008 11:20:23 +0000 (12:20 +0100)]
remove unused behvavior cruft in xfs_super.h

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoremove useless mnt_want_write call in xfs_write
Christoph Hellwig [Wed, 3 Dec 2008 11:20:22 +0000 (12:20 +0100)]
remove useless mnt_want_write call in xfs_write

When mnt_want_write was introduced a call to it was added around
xfs_ichgtime, but there is no need for this because a file can't be open
read/write on a r/o mount, and a mount can't degrade r/o while we still
have files open for writing.  As the mnt_want_write changes were never
merged into the CVS tree this patch is for mainline only.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] fix compile on 32 bit systems
Christoph Hellwig [Wed, 3 Dec 2008 12:55:34 +0000 (07:55 -0500)]
[XFS] fix compile on 32 bit systems

The recent compat patches make xfs_file.c include xfs_ioctl32.h unconditional,
which breaks the build on 32 bit systems which don't have the various compat
defintions.

Remove the include and move the defintion of xfs_file_compat_ioctl to
xfs_ioctl.h so that we can avoid including all the compat defintions in
xfs_file.c

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Reorder xfs_ioctl32.c for some tidiness
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:17 +0000 (21:20 -0600)]
[XFS] Reorder xfs_ioctl32.c for some tidiness

Put things in IMHO a more readable order, now
that it's all done; add some comments.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Hook up compat XFS_IOC_FSSETDM_BY_HANDLE ioctl handler
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:16 +0000 (21:20 -0600)]
[XFS] Hook up compat XFS_IOC_FSSETDM_BY_HANDLE ioctl handler

Add a compat handler for XFS_IOC_FSSETDM_BY_HANDLE.

I haven't tested this, lacking dmapi tools to do so
(unless xfsqa magically gets this somehow?)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Hook up compat XFS_IOC_ATTRMULTI_BY_HANDLE ioctl handler
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:15 +0000 (21:20 -0600)]
[XFS] Hook up compat XFS_IOC_ATTRMULTI_BY_HANDLE ioctl handler

Add a compat handler for XFS_IOC_ATTRMULTI_BY_HANDLE

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Hook up compat XFS_IOC_ATTRLIST_BY_HANDLE ioctl handler
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:14 +0000 (21:20 -0600)]
[XFS] Hook up compat XFS_IOC_ATTRLIST_BY_HANDLE ioctl handler

Add a compat handler for XFS_IOC_ATTRLIST_BY_HANDLE

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Fix compat XFS_IOC_FSBULKSTAT_SINGLE ioctl
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:13 +0000 (21:20 -0600)]
[XFS] Fix compat XFS_IOC_FSBULKSTAT_SINGLE ioctl

The XFS_IOC_FSBULKSTAT_SINGLE ioctl passes in the
desired inode number, while XFS_IOC_FSBULKSTAT passes
in the previous/last-stat'd inode number.  The
compat handler wasn't differentiating these, so
when a XFS_IOC_FSBULKSTAT_SINGLE request for inode
128 was sent in, stat information for 131 was sent out.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Fix xfs_bulkstat_one size checks & error handling
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:12 +0000 (21:20 -0600)]
[XFS] Fix xfs_bulkstat_one size checks & error handling

The 32-bit xfs_blkstat_one handler was failing because
a size check checked whether the remaining (32-bit)
user buffer was less than the (64-bit) bulkstat buffer,
and failed with ENOMEM if so.  Move this check
into the respective handlers so that they check the
correct sizes.

Also, the formatters were returning negative errors
or positive bytes copied; this was odd in the positive
error value world of xfs, and handled wrong by at least
some of the callers, which treated the bytes returned
as an error value.  Move the bytes-used assignment
into the formatters.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Make the bulkstat_one compat ioctl handling more sane
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:11 +0000 (21:20 -0600)]
[XFS] Make the bulkstat_one compat ioctl handling more sane

Currently the compat formatter was handled by passing
in "private_data" for the xfs_bulkstat_one formatter,
which was really just another formatter... IMHO this
got confusing.

Instead, just make a new xfs_bulkstat_one_compat
formatter for xfs_bulkstat, and call it via a wrapper.

Also, don't translate the ioctl nrs into their native
counterparts, that just clouds the issue; we're in a
compat handler anyway, just switch on the 32-bit cmds.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Add compat handlers for data & rt growfs ioctls
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:10 +0000 (21:20 -0600)]
[XFS] Add compat handlers for data & rt growfs ioctls

The args for XFS_IOC_FSGROWFSDATA and XFS_IOC_FSGROWFSRTA
have padding on the end on intel, so add arg copyin functions,
and then just call the growfs ioctl helpers.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Add compat handlers for swapext ioctl
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:09 +0000 (21:20 -0600)]
[XFS] Add compat handlers for swapext ioctl

The big hitter here was the bstat field, which contains
different sized time_t on 32 vs. 64 bit.  Add a copyin
function to translate the 32-bit arg to 64-bit, and
call the swapext ioctl helper.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Clean up some existing compat ioctl calls
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:08 +0000 (21:20 -0600)]
[XFS] Clean up some existing compat ioctl calls

Create a new xfs_ioctl.h file which has prototypes for
ioctl helpers that may be called in compat mode.

Change several compat ioctl cases which are IOW to simply copy
in the userspace argument, then call the common ioctl helper.

This also fixes xfs_compat_ioc_fsgeometry_v1(), which had
it backwards before; it copied in an (empty) arg, then copied
out the native result, which probably corrupted userspace.  It
should be translating on the copyout.

Also, a bit of formatting cleanup for consistency, and conversion
of all error returns to use XFS_ERROR().

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Move compat ioctl structs & numbers into xfs_ioctl32.h
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:07 +0000 (21:20 -0600)]
[XFS] Move compat ioctl structs & numbers into xfs_ioctl32.h

This makes the c file less cluttered and a bit more
readable.   Consistently name the ioctl number
macros with "_32" and the compatibility stuctures
with "_compat."  Rename the helpers which simply
copy in the arg with "_copyin" for easy identification.

Finally, for a few of the existing helpers, modify them
so that they directly call the native ioctl helper
after userspace argument fixup.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch.
sandeen@sandeen.net [Wed, 26 Nov 2008 03:20:06 +0000 (21:20 -0600)]
[XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch.

Moving the copy_from_user out of some of the ioctl helpers will
make it easier for the compat ioctl switch to copy in the right
struct, then just pass to the underlying helper.

Also, move common access checks into the helpers themselves,
and out of the native ioctl switch code, to reduce code
duplication between native & compat ioctl callers.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
15 years ago[XFS] fix error handling in xlog_recover_process_one_iunlink
Christoph Hellwig [Fri, 28 Nov 2008 03:23:42 +0000 (14:23 +1100)]
[XFS] fix error handling in xlog_recover_process_one_iunlink

If we fail after xfs_iget we have to drop the reference count, spotted
by Dave Chinner.  Also remove some useless asserts and stop trying to
deal with di_mode == 0 inodes because never gets those without passing
the IGET_CREATE flag to xfs_iget.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] move inode allocation out xfs_iread
Christoph Hellwig [Fri, 28 Nov 2008 03:23:42 +0000 (14:23 +1100)]
[XFS] move inode allocation out xfs_iread

Allocate the inode in xfs_iget_cache_miss and pass it into xfs_iread.  This
simplifies the error handling and allows xfs_iread to be shared with userspace
which already uses these semantics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] kill the XFS_IMAP_BULKSTAT flag
Christoph Hellwig [Fri, 28 Nov 2008 03:23:41 +0000 (14:23 +1100)]
[XFS] kill the XFS_IMAP_BULKSTAT flag

Just pass down the XFS_IGET_* flags all the way down to xfs_imap instead
of translating them mid-way.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] embededd struct xfs_imap into xfs_inode
Christoph Hellwig [Fri, 28 Nov 2008 03:23:41 +0000 (14:23 +1100)]
[XFS] embededd struct xfs_imap into xfs_inode

Most uses of struct xfs_imap are to map and inode to a buffer.  To avoid
copying around the inode location information we should just embedd a
strcut xfs_imap into the xfs_inode.  To make sure it doesn't bloat an
inode the im_len is changed to a ushort, which is fine as that's what
the users exepect anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] merge xfs_imap into xfs_dilocate
Christoph Hellwig [Fri, 28 Nov 2008 03:23:41 +0000 (14:23 +1100)]
[XFS] merge xfs_imap into xfs_dilocate

xfs_imap is the only caller of xfs_dilocate and doesn't add any significant
value.  Merge the two functions and document the various cases we have for
inode cluster lookup in the new xfs_imap.

Also remove the unused im_agblkno and im_ioffset fields from struct xfs_imap
while we're at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] remove dead code for old inode item recovery
Christoph Hellwig [Fri, 28 Nov 2008 03:23:40 +0000 (14:23 +1100)]
[XFS] remove dead code for old inode item recovery

We have removed the support for old-style inode items a while ago and
xlog_recover_do_inode_trans is now only called for XFS_LI_INODE items.
That means we can remove the call to xfs_imap there and with it the
XFS_IMAP_LOOKUP that is set by all other callers.  We can also mark
xfs_imap static now.

(First sent on October 21st)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] stop using xfs_itobp in xfs_iread
Christoph Hellwig [Fri, 28 Nov 2008 03:23:40 +0000 (14:23 +1100)]
[XFS] stop using xfs_itobp in xfs_iread

The only caller of xfs_itobp that doesn't have i_blkno setup is now
the initial inode read.  It needs access to the whole xfs_imap so using
xfs_inotobp is not an option.  Instead opencode the buffer lookup in
xfs_iread and kill all the functionality for the initial map from
xfs_itobp.

(First sent on October 21st)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] split up xlog_recover_process_iunlinks
Christoph Hellwig [Fri, 28 Nov 2008 03:23:40 +0000 (14:23 +1100)]
[XFS] split up xlog_recover_process_iunlinks

Split out the body of the main loop into a separate helper to make the
code readable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] kill XFS_DINODE_VERSION_ defines
Christoph Hellwig [Fri, 28 Nov 2008 03:23:39 +0000 (14:23 +1100)]
[XFS] kill XFS_DINODE_VERSION_ defines

These names don't add any value at all over just using the numerical
values.

(First sent on October 9th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] kill xfs_dinode_core_t
Christoph Hellwig [Fri, 28 Nov 2008 03:23:39 +0000 (14:23 +1100)]
[XFS] kill xfs_dinode_core_t

Now that we have a separate xfs_icdinode_t for the in-core inode which
gets logged there is no need anymore for the xfs_dinode vs xfs_dinode_core
split - the fact that part of the structure gets logged through the inode
log item and a small part not can better be described in a comment.

All sizeof operations on the dinode_core either really wanted the
icdinode and are switched to that one, or had already added the size
of the agi unlinked list pointer.  Later both will be replaced with
helpers once we get the larger CRC-enabled dinode.

Removing the data and attribute fork unions also has the advantage that
xfs_dinode.h doesn't need to pull in every header under the sun.

While we're at it also add some more comments describing the dinode
structure.

(First sent on October 7th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] kill xfs_ialloc_log_di
Christoph Hellwig [Fri, 28 Nov 2008 03:23:38 +0000 (14:23 +1100)]
[XFS] kill xfs_ialloc_log_di

xfs_ialloc_log_di is only used to log the full inode core + di_next_unlinked.
That means all the offset magic is not nessecary and we can simply use
xfs_trans_log_buf directly.  Also add a comment describing what we should do
here instead.

(First sent on October 7th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] sanitize xlog_in_core_t definition
Christoph Hellwig [Fri, 28 Nov 2008 03:23:38 +0000 (14:23 +1100)]
[XFS] sanitize xlog_in_core_t definition

Move all fields from xlog_iclog_fields_t into xlog_in_core_t instead of having
them in a substructure and the using #defines to make it look like they were
directly in xlog_in_core_t.  Also document that xlog_in_core_2_t is grossly
misnamed, and make all references to it typesafe.

(First sent on Semptember 15th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] factor out xfs_read_agf helper
From: Christoph Hellwig [Fri, 28 Nov 2008 03:23:38 +0000 (14:23 +1100)]
[XFS] factor out xfs_read_agf helper

Add a helper to read the AGF header and perform basic verification.
Based on hunks from a larger patch from Dave Chinner.

(First sent on Juli 23rd)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] factor out xfs_read_agi helper
Christoph Hellwig [Fri, 28 Nov 2008 03:23:37 +0000 (14:23 +1100)]
[XFS] factor out xfs_read_agi helper

Add a helper to read the AGI header and perform basic verification.
Based on hunks from a larger patch from Dave Chinner.

(First sent on Juli 23rd)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] remove i_gen from incore inode
Dave Chinner [Fri, 28 Nov 2008 03:23:37 +0000 (14:23 +1100)]
[XFS] remove i_gen from incore inode

i_gen is incremented in directory operations when the
directory is changed. It is never read or otherwise used
so it should be removed to help reduce the size of the
struct xfs_inode.

The patch also removes a duplicate logging of the directory
inode core. We only need to do this once per transaction
so kill the one associated with the i_gen increment.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] remove xfs_vfsops.h
Christoph Hellwig [Fri, 28 Nov 2008 03:23:37 +0000 (14:23 +1100)]
[XFS] remove xfs_vfsops.h

The only thing left is xfs_do_force_shutdown which already has a defintion
in xfs_mount.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] remove xfs_vfs.h
Christoph Hellwig [Fri, 28 Nov 2008 03:23:36 +0000 (14:23 +1100)]
[XFS] remove xfs_vfs.h

The only thing left are the forced shutdown flags and freeze macros which
fit into xfs_mount.h much better.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] remove bhv_statvfs_t typedef
Christoph Hellwig [Fri, 28 Nov 2008 03:23:36 +0000 (14:23 +1100)]
[XFS] remove bhv_statvfs_t typedef

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] Hook up the fiemap ioctl.
Eric Sandeen [Fri, 28 Nov 2008 03:23:35 +0000 (14:23 +1100)]
[XFS] Hook up the fiemap ioctl.

This adds the fiemap inode_operation, which for us converts the
fiemap values & flags into a getbmapx structure which can be sent
to xfs_getbmap.  The formatter then copies the bmv array back into
the user's fiemap buffer via the fiemap helpers.

If we wanted to be more clever, we could also return mapping data
for in-inode attributes, but I'm not terribly motivated to do that
just yet.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] Add new getbmap flags.
Eric Sandeen [Fri, 28 Nov 2008 03:23:35 +0000 (14:23 +1100)]
[XFS] Add new getbmap flags.

This adds a new output flag, BMV_OF_LAST to indicate if we've hit
the last extent in the inode.  This potentially saves an extra call
from userspace to see when the whole mapping is done.

It also adds BMV_IF_DELALLOC and BMV_OF_DELALLOC to request, and
indicate, delayed-allocation extents.  In this case bmv_block
is set to -2 (-1 was already taken for HOLESTARTBLOCK; unfortunately
these are the reverse of the in-kernel constants.)

These new flags facilitate addition of the new fiemap interface.

Rather than adding sh_delalloc, remove sh_unwritten & just test
the flags directly.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] convert xfs_getbmap to take formatter functions
Eric Sandeen [Fri, 28 Nov 2008 03:23:35 +0000 (14:23 +1100)]
[XFS] convert xfs_getbmap to take formatter functions

Preliminary work to hook up fiemap, this allows us to pass in an
arbitrary formatter to copy extent data back to userspace.

The formatter takes info for 1 extent, a pointer to the user "thing*"
and a pointer to a "filled" variable to indicate whether a userspace
buffer did get filled in (for fiemap, hole "extents" are skipped).

I'm just using the getbmapx struct as a "common denominator" because
as far as I can see, it holds all info that any formatters will care
about.

("*thing" because fiemap doesn't pass the user pointer around, but rather
has a pointer to a fiemap info structure, and helpers associated with it)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] fix uninitialised variable bug in dquot release.
Dave Chinner [Fri, 28 Nov 2008 03:23:34 +0000 (14:23 +1100)]
[XFS] fix uninitialised variable bug in dquot release.

gcc is warning about an uninitialised variable in xfs_growfs_rt().
This is a false positive. Fix it by changing the scope of the
transaction pointer to wholly within the internal loop inside
the function.

While there, preemptively change xfs_growfs_rt_alloc() in the
same way as it has exactly the same structure as xfs_growfs_rt()
but gcc is not warning about it. Yet.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] fix error inversion problems with data flushing
Dave Chinner [Fri, 28 Nov 2008 03:23:33 +0000 (14:23 +1100)]
[XFS] fix error inversion problems with data flushing

XFS gets the sign of the error wrong in several places when
gathering the error from generic linux functions. These functions
return negative error values, while the core XFS code returns
positive error values. Hence when XFS inverts the error to be
returned to the VFS, it can incorrectly invert a negative
error and this error will be ignored by the syscall return.

Fix all the problems related to calling filemap_* functions.

Problem initially identified by Nick Piggin in xfs_fsync().

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] fix spurious gcc warnings
Christoph Hellwig [Fri, 28 Nov 2008 03:23:33 +0000 (14:23 +1100)]
[XFS] fix spurious gcc warnings

Some recent gcc warnings don't like passing string variables to
printf-like functions without using at least a "%s" format string.
Change the two occurances of that in xfs to please gcc.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] allow inode64 mount option on 32 bit systems
Christoph Hellwig [Fri, 28 Nov 2008 03:23:32 +0000 (14:23 +1100)]
[XFS] allow inode64 mount option on 32 bit systems

Now that we've stopped using the Linux inode cache when can trivally
support the inode64 mount option on 32bit architectures.  As far as the
kernel and most userspace is concerned this works perfectly, but
applications still using really old stat and readdir interfaces will get
an EOVERFLOW error when hitting an inode number not fitting into 32
bits (that problem of course also exists when using these applications
on a 64bit kernel).

Note that because inode64 is simply a mount option we can currently
mount a filesystem having > 32 bit inode numbers and cause a variety of
problems, all this is solved but this patch which enables XFS_BIG_INUMS,
even when inode64 is not used.

(First sent on October 18th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] wire up ->open for directories
Christoph Hellwig [Fri, 28 Nov 2008 03:23:32 +0000 (14:23 +1100)]
[XFS] wire up ->open for directories

Currently there's no ->open method set for directories on XFS.  That
means we don't perform any check for opening too large directories
without O_LARGEFILE, we don't check for shut down filesystems, and we
don't actually do the readahead for the first block in the directory.

Instead of just setting the directories open routine to xfs_file_open
we merge the shutdown check directly into xfs_file_open and create
a new xfs_dir_open that first calls xfs_file_open and then performs
the readahead for block 0.

(First sent on September 29th)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years ago[XFS] fix NULL pointer dereference in xfs_log_force_umount
Christoph Hellwig [Fri, 28 Nov 2008 03:23:31 +0000 (14:23 +1100)]
[XFS] fix NULL pointer dereference in xfs_log_force_umount

xfs_log_force_umount may be called very early during log recovery where

If we fail a buffer read in xlog_recover_do_inode_trans we abort the mount.
But at that point log recovery has started delayed writeback of inode
buffers.   As part of the aborted mount we try to flush out all delwri
buffers, but at that point we have already freed the superblock, and set
mp->m_sb_bp to NULL, and xfs_log_force_umount which gets called after
the inode buffer writeback trips over it.

Make xfs_log_force_umount a little more careful when accessing mp->m_sb_bp
to avoid this.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Lachlan McIlroy [Fri, 28 Nov 2008 04:23:52 +0000 (15:23 +1100)]
Merge git://git./linux/kernel/git/torvalds/linux-2.6

15 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Fri, 21 Nov 2008 02:08:09 +0000 (18:08 -0800)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 5330/1: mach-pxa: Fixup reset for systems using reboot=cold or other strings
  [ARM] pxa: fix incorrect PCMCIA PSKTSEL pin configuration for spitz
  [ARM] pxa: fix I2C controller device being registered twice on Akita
  pxafb: only initialize the smart panel thread when dealing with a smartpanel
  pxafb: introduce LCD_TYPE_MASK and use it.

15 years agoLinux 2.6.28-rc6 v2.6.28-rc6
Linus Torvalds [Thu, 20 Nov 2008 23:19:22 +0000 (15:19 -0800)]
Linux 2.6.28-rc6

15 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Thu, 20 Nov 2008 23:07:40 +0000 (15:07 -0800)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] xen: fix xen_get_eflags.
  [IA64] ia64/pv_ops/pv_cpu_ops: fix _IA64_REG_IP case.
  [IA64] remove duplicate include iommu.h
  [IA64] use mprintk instead of printk, in ia64_mca_modify_original_stack
  [IA64] Rationalize kernel mode alignment checking

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Linus Torvalds [Thu, 20 Nov 2008 21:53:21 +0000 (13:53 -0800)]
Merge git://git./linux/kernel/git/gregkh/usb-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: ACE1001 patch for cp2101.c
  USB: usbmon: fix read(2)
  USB: gadget rndis: send notifications
  USB: gadget rndis: stop windows self-immolation
  USB: storage: update unusual_devs entries for Nokia 5300 and 5310
  USB: storage: updates unusual_devs entry for the Nokia 6300
  usb: musb: fix bug in musb_schedule
  USB: fix SB700 usb subsystem hang bug

15 years ago[IA64] xen: fix xen_get_eflags.
Isaku Yamahata [Tue, 18 Nov 2008 10:20:51 +0000 (19:20 +0900)]
[IA64] xen: fix xen_get_eflags.

fix xen_get_eflags. It doesn't take any argument.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years ago[IA64] ia64/pv_ops/pv_cpu_ops: fix _IA64_REG_IP case.
Isaku Yamahata [Tue, 18 Nov 2008 10:19:50 +0000 (19:19 +0900)]
[IA64] ia64/pv_ops/pv_cpu_ops: fix _IA64_REG_IP case.

pv_cpu_ops.getreg(_IA64_REG_IP) returned constant.
But the returned ip valued should be the one in the caller, not of the callee.
This patch fixes that.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years ago[IA64] remove duplicate include iommu.h
Huang Weiyi [Thu, 20 Nov 2008 21:38:16 +0000 (13:38 -0800)]
[IA64] remove duplicate include iommu.h

arch/ia64/kernel/pci-dma.c only needs to include iommu once.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years ago[IA64] use mprintk instead of printk, in ia64_mca_modify_original_stack
Hidetoshi Seto [Mon, 17 Nov 2008 01:18:08 +0000 (10:18 +0900)]
[IA64] use mprintk instead of printk, in ia64_mca_modify_original_stack

Using printk from MCA/INIT context is unsafe since it can cause deadlock.
The ia64_mca_modify_original_stack is called from both of mca handler and
init handler, so it should use mprintk instead of printk.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years ago[IA64] Rationalize kernel mode alignment checking
Tony Luck [Thu, 20 Nov 2008 21:27:12 +0000 (13:27 -0800)]
[IA64] Rationalize kernel mode alignment checking

Itanium processors can handle some misaligned data accesses. They
also provide a mode where all such accesses are forced to trap. The
kernel was schizophrenic about use of this mode:

* Base kernel code ran in permissive mode where the only traps
  generated were from those cases that the h/w could not handle.
* Interrupt, syscall and trap code ran in strict mode where all
  unaligned accesses caused traps to the 0x5a00 unaligned reference
  vector.

Use strict alignment checking throughout the kernel, but make
sure that we continue to let user mode use more relaxed mode
as the default.

Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years agox86: Fix interrupt leak due to migration
Matthew Wilcox [Thu, 20 Nov 2008 21:09:33 +0000 (14:09 -0700)]
x86: Fix interrupt leak due to migration

When we migrate an interrupt from one CPU to another, we set the
move_in_progress flag and clean up the vectors later once they're not
being used.  If you're unlucky and call destroy_irq() before the vectors
become un-used, the move_in_progress flag is never cleared, which causes
the interrupt to become unusable.

This was discovered by Jesse Brandeburg for whom it manifested as an
MSI-X device refusing to use MSI-X mode when the driver was unloaded
and reloaded repeatedly.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoSUNRPC: Fix a performance regression in the RPC authentication code
Trond Myklebust [Thu, 20 Nov 2008 21:06:21 +0000 (16:06 -0500)]
SUNRPC: Fix a performance regression in the RPC authentication code

Fix a regression reported by Max Kellermann whereby kernel profiling
showed that his clients were spending 45% of their time in
rpcauth_lookup_credcache.

It turns out that although his processes had identical uid/gid/groups,
generic_match() was failing to detect this, because the task->group_info
pointers were not shared. This again lead to the creation of a huge number
of identical credentials at the RPC layer.

The regression is fixed by comparing the contents of task->group_info
if the actual pointers are not identical.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Thu, 20 Nov 2008 21:14:16 +0000 (13:14 -0800)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Do not attempt to close invalidated file handles
  [CIFS] fix check for dead tcon in smb_init

15 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Thu, 20 Nov 2008 21:13:48 +0000 (13:13 -0800)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: csrc-r4k: Fix declaration depending on the wrong CONFIG_ symbol.
  MIPS: csrc-r4k: Fix spelling mistake.
  MIPS: RB532: Provide functions for gpio configuration
  MIPS: IP22: Make indy_sc_ops variable static
  MIPS: RB532: GPIO register offsets are relative to GPIOBASE
  MIPS: Malta: Fix include paths in malta-amon.c

15 years agoMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 20 Nov 2008 21:13:03 +0000 (13:13 -0800)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  intel-iommu: fix compile warnings

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 20 Nov 2008 21:12:14 +0000 (13:12 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (23 commits)
  net: fix tiny output corruption of /proc/net/snmp6
  atl2: don't request irq on resume if netif running
  ipv6: use seq_release_private for ip6mr.c /proc entries
  pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()
  smc911x: Fix printf format typo in smc911x driver.
  asix: Fix asix-based cards connecting to 10/100Mbs LAN.
  mv643xx_eth: fix recycle check bound
  mv643xx_eth: fix the order of mdiobus_{unregister, free}() calls
  sh: sh_eth: Update to change of mii_bus
  TPROXY: supply a struct flowi->flags argument in inet_sk_rebuild_header()
  TPROXY: fill struct flowi->flags in udp_sendmsg()
  net: ipg.c fix bracing on endian swapping
  phylib: Fix auto-negotiation restart avoidance
  net: jme.c rxdesc.flags is __le16, other missing endian swaps
  phylib: fix phy name example in documentation
  net: Do not fire linkwatch events until the device is registered.
  phonet: fix compilation with gcc-3.4
  ixgbe: fix compilation with gcc-3.4
  pktgen: fix multiple queue warning
  net: fix ip_mr_init() error path
  ...

15 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 20 Nov 2008 21:11:21 +0000 (13:11 -0800)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: fix dyn ftrace filter selection
  ftrace: make filtered functions effective on setting
  ftrace: fix set_ftrace_filter
  trace: introduce missing mutex_unlock()
  tracing: kernel/trace/trace.c: introduce missing kfree()

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 20 Nov 2008 21:09:32 +0000 (13:09 -0800)]
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: uaccess_64: fix return value in __copy_from_user()
  x86: quirk for reboot stalls on a Dell Optiplex 330

15 years agoparisc: fix bug in compat_arch_ptrace
Helge Deller [Thu, 20 Nov 2008 09:54:09 +0000 (10:54 +0100)]
parisc: fix bug in compat_arch_ptrace

Commit 81e192d6ce303b6792aa38ff35f41a1a7357f23a ("parisc: convert to
generic compat_sys_ptrace") introduced a bug which segfaults the parisc
64bit kernel when stracing 32bit applications:

  Kernel Fault: Code=15 regs=00000000bafa42b0 (Addr=00000001baf5ab57)
       YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
  PSW: 00001000000001101111111100001011 Tainted: G        W
  r00-03  000000ff0806ff0b 000000004068edc0 00000000401203f8 00000000fb3e2508
  r04-07  0000000040686dc0 00000000baf5a800 fffffffffffffffc fffffffffb3e2508
  r08-11  00000000baf5a800 000000000004b068 00000000000402b0 0000000000040d68
  r12-15  0000000000042a9c 0000000000040a9c 0000000000040d60 0000000000042e9c
  r16-19  000000000004b060 000000000004b058 0000000000042d9c ffffffffffffffff
  r20-23  000000000800000b 0000000000000000 000000000800000b fffffffffb3e2508
  r24-27  00000000fffffffc 0000000000000003 00000000fffffffc 0000000040686dc0
  r28-31  00000001baf5a7ff 00000000bafa4280 00000000bafa42b0 00000000000001d7
  sr00-03  0000000000fca000 0000000000000000 0000000000000000 0000000000fca000
  sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000

  IASQ: 0000000000000000 0000000000000000 IAOQ: 0000000040120400 0000000040120404
   IIR: 4b9a06b0    ISR: 0000000000000000  IOR: 00000001baf5ab57
   CPU:        0   CR30: 00000000bafa4000 CR31: 00000000d22344e0
   ORIG_R28: 00000000fb3e2248
   IAOQ[0]: compat_arch_ptrace+0xb8/0x160
   IAOQ[1]: compat_arch_ptrace+0xbc/0x160
   RP(r2): compat_arch_ptrace+0xb0/0x160
  Backtrace:
   [<00000000401612ac>] compat_sys_ptrace+0x15c/0x180
   [<0000000040104ef8>] syscall_exit+0x0/0x14

The problem is that compat_arch_ptrace() enters with an addr value of
type compat_ulong_t and calls translate_usr_offset() to translate the
address offset into a struct pt_regs offset like this:

addr = translate_usr_offset(addr)

this means that any return value of translate_usr_offset() is stored
back as compat_ulong_t type into the addr variable.

But since translate_usr_offset() returns -1 for invalid offsets, addr
can now get the value 0xffffffff which then fails the next return-value
sanity check and thus the kernel tries to access invalid memory:

if (addr < 0)
break;

Fix this bug by modifying translate_usr_offset() to take and return
values of type compat_ulong_t, and by returning the value
"sizeof(struct pt_regs)" as an error indicator.

Additionally change the sanity check to check for return values
for >= sizeof(struct pt_regs).

This patch survived my compile and run-tests.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[CIFS] Do not attempt to close invalidated file handles
Steve French [Thu, 20 Nov 2008 20:00:44 +0000 (20:00 +0000)]
[CIFS] Do not attempt to close invalidated file handles

If a connection with open file handles has gone down
and come back up and reconnected without reopening
the file handle yet, do not attempt to send an SMB close
request for this handle in cifs_close.  We were
checking for the connection being invalid in cifs_close
but since the connection may have been reconnected
we also need to check whether the file handle
was marked invalid (otherwise we could close the
wrong file handle by accident).

Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agoMIPS: csrc-r4k: Fix declaration depending on the wrong CONFIG_ symbol.
Ralf Baechle [Mon, 3 Nov 2008 11:32:34 +0000 (11:32 +0000)]
MIPS: csrc-r4k: Fix declaration depending on the wrong CONFIG_ symbol.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: csrc-r4k: Fix spelling mistake.
Ralf Baechle [Mon, 3 Nov 2008 11:31:54 +0000 (11:31 +0000)]
MIPS: csrc-r4k: Fix spelling mistake.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Provide functions for gpio configuration
Phil Sutter [Sat, 1 Nov 2008 14:13:21 +0000 (15:13 +0100)]
MIPS: RB532: Provide functions for gpio configuration

As gpiolib doesn't support pin multiplexing, it provides no way to
access the GPIOFUNC register. Also there is no support for setting
interrupt status and level. These functions provide access to them and
are needed by the CompactFlash driver.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: IP22: Make indy_sc_ops variable static
Dmitri Vorobiev [Fri, 31 Oct 2008 17:54:11 +0000 (19:54 +0200)]
MIPS: IP22: Make indy_sc_ops variable static

The indy_sc_ops variable in arch/mips/mm/sc-ip22.c is needlessly defined
global, and this patch makes it static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---

15 years agoMIPS: RB532: GPIO register offsets are relative to GPIOBASE
Florian Fainelli [Fri, 31 Oct 2008 13:24:29 +0000 (14:24 +0100)]
MIPS: RB532: GPIO register offsets are relative to GPIOBASE

This patch fixes the wrong use of GPIO register offsets
in devices.c. To avoid further problems, use gpio_get_value
to return the NAND status instead of our own expanded code.

Also define the zero offset of the alternate function register to allow
consistent access.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: Malta: Fix include paths in malta-amon.c
David Daney [Sat, 20 Sep 2008 17:16:36 +0000 (10:16 -0700)]
MIPS: Malta: Fix include paths in malta-amon.c

On linux-queue, malta doesn't build after the include file relocation.
This should fix it.

There some occurrences of 'asm-mips' in the comments of quite a few
files, but this is the only place I found it in any code.

Signed-off-by: David Daney <ddaney@avtrex.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agonet: fix tiny output corruption of /proc/net/snmp6
Alexey Dobriyan [Thu, 20 Nov 2008 12:20:10 +0000 (04:20 -0800)]
net: fix tiny output corruption of /proc/net/snmp6

Because "name" is static, it can be occasionally be filled with
somewhat garbage if two processes read /proc/net/snmp6.

Also, remove useless casts and "-1" -- snprintf() correctly terminates it's
output.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl2: don't request irq on resume if netif running
Alan Jenkins [Thu, 20 Nov 2008 12:18:25 +0000 (04:18 -0800)]
atl2: don't request irq on resume if netif running

If the device is suspended with the cable disconnected, then
resumed with the cable connected, dev->open is called before
resume. During resume, we request an IRQ, but the IRQ was
already assigned during dev->open, resulting in the warning
shown below.

Don't request an IRQ if the device is running.

Call Trace:
 [<c011b89a>] warn_on_slowpath+0x40/0x59
 [<c023df15>] raw_pci_read+0x4d/0x55
 [<c023dff3>] pci_read+0x1c/0x21
 [<c01bcd81>] __pci_find_next_cap_ttl+0x44/0x70
 [<c01bce86>] __pci_find_next_cap+0x1a/0x1f
 [<c01bcef9>] pci_find_capability+0x28/0x2c
 [<c01c4144>] pci_msi_check_device+0x53/0x62
 [<c01c49c2>] pci_enable_msi+0x3a/0x1cd
 [<e019f17b>] atl2_write_phy_reg+0x40/0x5f [atl2]
 [<c01061b1>] dma_generic_alloc_coherent+0x0/0xd7
 [<e019f107>] atl2_request_irq+0x15/0x49 [atl2]
 [<e01a1481>] atl2_open+0x20b/0x297 [atl2]
 [<c024a35c>] dev_open+0x62/0x91
 [<c0248b9a>] dev_change_flags+0x93/0x141
 [<c024f308>] do_setlink+0x238/0x2d5
 [<c02501b2>] rtnl_setlink+0xa9/0xbf
 [<c0297f0c>] mutex_lock+0xb/0x19
 [<c024ffa7>] rtnl_dump_ifinfo+0x0/0x69
 [<c0250109>] rtnl_setlink+0x0/0xbf
 [<c024fe42>] rtnetlink_rcv_msg+0x185/0x19f
 [<c0240fd1>] sock_rmalloc+0x23/0x57
 [<c024fcbd>] rtnetlink_rcv_msg+0x0/0x19f
 [<c0259457>] netlink_rcv_skb+0x2d/0x71
 [<c024fcb7>] rtnetlink_rcv+0x14/0x1a
 [<c025929e>] netlink_unicast+0x184/0x1e4
 [<c025992a>] netlink_sendmsg+0x233/0x240
 [<c023f405>] sock_sendmsg+0xb7/0xd0
 [<c0129131>] autoremove_wake_function+0x0/0x2b
 [<c0129131>] autoremove_wake_function+0x0/0x2b
 [<c0147796>] mempool_alloc+0x2d/0x9e
 [<c020c923>] scsi_pool_alloc_command+0x35/0x4f
 [<c0297f0c>] mutex_lock+0xb/0x19
 [<c028e867>] unix_stream_recvmsg+0x357/0x3e2
 [<c01b81c9>] copy_from_user+0x23/0x4f
 [<c02452ea>] verify_iovec+0x3e/0x6c
 [<c023f5ab>] sys_sendmsg+0x18d/0x1f0
 [<c023ffa8>] sys_recvmsg+0x146/0x1c8
 [<c0240016>] sys_recvmsg+0x1b4/0x1c8
 [<c0118f48>] __wake_up+0xf/0x15
 [<c02586cd>] netlink_table_ungrab+0x17/0x19
 [<c01b83ba>] copy_to_user+0x25/0x3b
 [<c023fe4a>] move_addr_to_user+0x50/0x68
 [<c0240266>] sys_getsockname+0x6f/0x9a
 [<c0240280>] sys_getsockname+0x89/0x9a
 [<c015046a>] do_wp_page+0x3ae/0x41a
 [<c0151525>] handle_mm_fault+0x4c5/0x540
 [<c02405d0>] sys_socketcall+0x176/0x1b0
 [<c010376d>] sysenter_do_call+0x12/0x21

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jay Cliburn <jcliburn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6: use seq_release_private for ip6mr.c /proc entries
Benjamin Thery [Thu, 20 Nov 2008 12:16:12 +0000 (04:16 -0800)]
ipv6: use seq_release_private for ip6mr.c /proc entries

In ip6mr.c, /proc entries /proc/net/ip6_mr_cache and /proc/net/ip6_mr_vif
are opened with seq_open_private(), thus seq_release_private() should be
used to release them.
Should fix a small memory leak.

Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: fix missing check for packet overrun in qdisc_dump_stab()
Patrick McHardy [Thu, 20 Nov 2008 12:07:14 +0000 (04:07 -0800)]
pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()

nla_nest_start() might return NULL, causing a NULL pointer dereference.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 20 Nov 2008 12:01:29 +0000 (04:01 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

15 years agosmc911x: Fix printf format typo in smc911x driver.
Vernon Sauder [Thu, 20 Nov 2008 09:56:08 +0000 (01:56 -0800)]
smc911x: Fix printf format typo in smc911x driver.

Signed-off-by: Vernon Sauder <VernonInHand@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoasix: Fix asix-based cards connecting to 10/100Mbs LAN.
Pantelis Koukousoulas [Thu, 20 Nov 2008 09:48:46 +0000 (01:48 -0800)]
asix: Fix asix-based cards connecting to 10/100Mbs LAN.

Add AX_MEDIUM_ENCK also when speed = 10/100Mbps. This allows my belkin
f5d5055 to work with my 100Mbps switch and with an old 10Mbps ISA card.
Without this patch, the card is recognized and the interface is brought
up fine, but no packets actually flow through the interface.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
Acked-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomv643xx_eth: fix recycle check bound
Lennert Buytenhek [Tue, 18 Nov 2008 04:28:58 +0000 (04:28 +0000)]
mv643xx_eth: fix recycle check bound

When mv643xx_eth allocates skbuffs, it adds
'dma_get_cache_alignment() - 1' to the length it needs, so that it can
align the skb's ->data pointer to a cache boundary.  When checking
whether a transmitted skbuff can be reused as a receive buffer, these
bytes needs to be included into the minimum bound for the recycle check.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomv643xx_eth: fix the order of mdiobus_{unregister, free}() calls
Lennert Buytenhek [Tue, 18 Nov 2008 04:28:35 +0000 (04:28 +0000)]
mv643xx_eth: fix the order of mdiobus_{unregister, free}() calls

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosh: sh_eth: Update to change of mii_bus
Nobuhiro Iwamatsu [Mon, 17 Nov 2008 20:29:58 +0000 (20:29 +0000)]
sh: sh_eth: Update to change of mii_bus

Update to change of mii_bus interface and fix some warning.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoTPROXY: supply a struct flowi->flags argument in inet_sk_rebuild_header()
Balazs Scheidler [Thu, 20 Nov 2008 09:08:06 +0000 (01:08 -0800)]
TPROXY: supply a struct flowi->flags argument in inet_sk_rebuild_header()

    inet_sk_rebuild_header() does a new route lookup if the dst_entry
    associated with a socket becomes stale. However inet_sk_rebuild_header()
    didn't use struct flowi->flags, causing the route lookup to
    fail for foreign-bound IP_TRANSPARENT sockets, causing an error
    state to be set for the sockets in question.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoTPROXY: fill struct flowi->flags in udp_sendmsg()
Balazs Scheidler [Thu, 20 Nov 2008 09:07:24 +0000 (01:07 -0800)]
TPROXY: fill struct flowi->flags in udp_sendmsg()

    udp_sendmsg() didn't fill struct flowi->flags, which means that
    the route lookup would fail for non-local IPs even if the
    IP_TRANSPARENT sockopt was set.

    This prevents sendto() to work properly for UDP sockets, whereas
    bind(foreign-ip) + connect() + send() worked fine.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoUSB: ACE1001 patch for cp2101.c
M Kondrin [Fri, 14 Nov 2008 10:02:45 +0000 (13:02 +0300)]
USB: ACE1001 patch for cp2101.c

The patch which adds IDs for AKTAKOM USB->RS232 cable
(http://www.aktakom.ru/product/kio/ace-1001.htm) is attached.

From: M Kondrin <mkondrin@hppi.troitsk.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usbmon: fix read(2)
Pete Zaitcev [Fri, 14 Nov 2008 16:47:41 +0000 (09:47 -0700)]
USB: usbmon: fix read(2)

There's a bug in the usbmon binary reader: When using read() to fetch
the packets and a packet's data is partially read, the next read call
will once again return up to len_cap bytes of data. The b_read counter
is not regarded when determining the remaining chunk size.

So, when dumping USB data with "cat /dev/usbmon0 > usbmon.trace" while
reading from a USB storage device and analyzing the dump file
afterwards it will get out of sync after a couple of packets.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>