Commit Graph

1346 Commits

Author SHA1 Message Date
Trond Myklebust
b37b03b705 NFS: Fix a spinlock recursion inside nfs_update_inode()
In cases where the server has gone insane, nfs_update_inode() may end
 up calling nfs_invalidate_inode(), which again calls stuff that takes
 the inode->i_lock that we're already holding.

 In addition, given the sort of things we have in NFS these days that
 need to be cleaned up on inode release, I'm not sure we should ever
 be calling make_bad_inode().

 Fix up spinlock recursion, and limit nfs_invalidate_inode() to clearing
 the caches, and marking the inode as being stale.

 Thanks to Steve Dickson <SteveD@redhat.com> for spotting this.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2005-11-25 17:11:29 -05:00
Trond Myklebust
ff6040667a NFSv4: Fix typo in lock caching
When caching locks due to holding a file delegation, we must always
 check against local locks before sending anything to the server.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2005-11-25 17:11:29 -05:00
Trond Myklebust
36f20c6df7 NFSv4: Fix buggy nfs_wait_on_sequence()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2005-11-25 17:11:28 -05:00
Nathan Scott
551c81e2d3 [XFS] Resolve the xlog_grant_log_space hang, revert inline to macro.
SGI-PV: 946205
SGI-Modid: xfs-linux-melb:xfs-kern:24567a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:42:28 +11:00
Nathan Scott
e0144ca553 [XFS] Fix a case where attr2 format was being used unconditionally.
SGI-PV: 941645
SGI-Modid: xfs-linux-melb:xfs-kern:24566a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:42:22 +11:00
Felix Blyakher
6b2cf618cc [XFS] Tight loop in xfs_finish_reclaim_all prevented the xfslogd to run
its queue of IO completion callbacks, thus creating the deadlock between
umount and xfslogd. Breaking the loop solves the problem.

SGI-PV: 943821
SGI-Modid: xfs-linux-melb:xfs-kern:202363a

Signed-off-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:42:13 +11:00
Nathan Scott
a4656391b7 [XFS] Fix a 32 bit value wraparound when providing a mapping for a large
direct write.

SGI-PV: 944820
SGI-Modid: xfs-linux-melb:xfs-kern:24351a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:41:57 +11:00
Christoph Hellwig
f33c6797bc [XFS] handle error returns from freeze_bdev
SGI-PV: 945483
SGI-Modid: xfs-linux-melb:xfs-kern:201884a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:41:47 +11:00
Eric Sandeen
55b02d74e1 [XFS] Fix potential overflow in xfs_iomap_t delta for very large extents
SGI-PV: 945311
SGI-Modid: xfs-linux-melb:xfs-kern:201708a

Signed-off-by: Eric Sandeen <sandeen@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2005-11-25 16:41:33 +11:00
Andrew Morton
02b7068221 [PATCH] jffs2 debug gcc-2.9x fix
Work around gcc-2.95.x macro expansion bug.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:39 -08:00
Oleg Nesterov
962b564cf1 [PATCH] fix do_wait() vs exec() race
When non-leader thread does exec, de_thread adds old leader to the init's
->children list in EXIT_ZOMBIE state and drops tasklist_lock.

This means that release_task(leader) in de_thread() is racy vs do_wait()
from init task.

I think de_thread() should set old leader's state to EXIT_DEAD instead.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: george anzinger <george@mvista.com>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:39 -08:00
David Gibson
74a8a65c52 [PATCH] Fix hugetlbfs_statfs() reporting of block limits
Currently, if a hugetlbfs is mounted without limits (the default), statfs()
will return -1 for max/free/used blocks.  This does not appear to be in
line with normal convention: simple_statfs() and shmem_statfs() both return
0 in similar cases.  Worse, it confuses the translation logic in
put_compat_statfs(), causing it to return -EOVERFLOW on such a mount.

This patch alters hugetlbfs_statfs() to return 0 for max/free/used blocks
on a mount without limits.  Note that we need the test in the patch below,
rather than just using 0 in the sbinfo structure, because the -1 marked in
the free blocks field is used internally to tell the

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-22 09:13:43 -08:00
David Gibson
86e07ce71a [PATCH] Fix error handling with put_compat_statfs()
In fs/compat.c, whenever put_compat_statfs() returns an error, the
containing syscall returns -EFAULT.  This is presumably by analogy with the
non-compat case, where any non-zero code from copy_to_user() should be
translated into an EFAULT.  However, put_compat_statfs() is also return
-EOVERFLOW.  The same applies for put_compat_statfs64().

This bug can be observed with a statfs() on a hugetlbfs directory.
hugetlbfs, when mounted without limits reports available, free and total
blocks as -1 (itself a bug, another patch coming).  statfs() will
mysteriously return EFAULT although it's parameters are perfectly valid
addresses.

This patch causes the compat versions of statfs() and statfs64() to
correctly propogate the return values from put_compat_statfs() and
put_compat_statfs64().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-22 09:13:43 -08:00
Linus Torvalds
1a324727ca Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2005-11-21 10:46:34 -08:00
Alexandra Kossovsky
4909724b5d [COMPAT] net: SIOCGIFCONF data corruption
From: Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>

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

There is user data corruption when using ioctl(SIOCGIFCONF) in 32-bit
application running amd64 kernel. I do not think that this problem is
exploitable, but any data corruption may lead to security problems.
Following code demonstrates the problem

#include <stdint.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <net/if.h>
#include <sys/ioctl.h>

char buf[256];

main()
{
	int s = socket(AF_INET, SOCK_DGRAM, 0);
	struct ifconf req;
	int i;

	req.ifc_buf = buf;
	req.ifc_len = 41;

	printf("Result %d\n", ioctl(s, SIOCGIFCONF, &req));
	printf("Len %d\n", req.ifc_len);
	for (i = 41; i < 256; i++)
		if (buf[i] != 0)
			printf("Byte %d is corrupted\n", i);
}
	
Steps to reproduce:
Compile the code above into 32-bit elf and run it. You'll get
Result 0
Len 32
Byte 48 is corrupted
Byte 52 is corrupted
Byte 53 is corrupted
Byte 54 is corrupted
Byte 55 is corrupted

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-11-20 13:41:59 -08:00
Andi Kleen
9e18fcdd34 [PATCH] Remove compat ioctl semaphore
Originally for 2.6.16, but the semaphore causes problems for some
people so get rid of it now.

It's not needed anymore because the ioctl hash table is never changed
at run time now.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-20 11:52:59 -08:00
Steve French
1e6b39fbb6 Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2005-11-19 21:05:42 -08:00
Steve French
cdbce9c87e [CIFS] Fix setattr of mode only (e.g. in some chmod cases) to Windows
so it does not return EACCESS (unless server really returns that).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-19 21:04:52 -08:00
Steve French
86c96b4bb7 [CIFS] Fix mknod of block and chardev over SFU mounts
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-18 20:25:31 -08:00
David S. Miller
bcb6ad1f5a [COMPAT]: EXT3_IOC_SETVERSION is _IOW() not _IOR().
Noticed by Helge Deller.

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-11-18 14:50:20 -08:00
Steve French
c119b87d59 [CIFS] Missing part of previous patch
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-18 12:27:27 -08:00
Steve French
3020a1f58c [CIFS] Fix scheduling while atomic when pending writes at file close time
Fix the case in which readdir reset file type when SFU mount option
specified.

Also fix sfu related functions to not request EAs (xattrs) when not
configured in Kconfig

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-18 11:31:10 -08:00
Steve French
87c89dd733 [CIFS] Vectored and async i/o turned on and correct the
writev and aio_write to flush properly.

This is Christoph's patch merged with the new nobrl file operations

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>

From: Christoph Hellwig <hch@lst.de>

 - support vectored and async aio ops unconditionally - this is above
   the pagecache and transparent to the fs
 - remove cifs_read_wrapper.  it was only doing silly checks and
   calling generic_file_write in all cases.
 - use do_sync_read/do_sync_write as read/write operations.  They call
   ->readv/->writev which we now always implemente.
 - add the filemap_fdatawrite calls to writev/aio_write which were
   missing previously compared to plain write.  no idea what the point
   behind them is, but let's be consistent at least..

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
2005-11-17 17:03:00 -08:00
Steve French
9e294f1c4d [CIFS] Recognize properly symlinks and char/blk devices (not just
FIFOs) created by SFU (part 2 of 2).

    Thanks to Martin Koeppe for useful analysis.

    Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-17 16:59:21 -08:00
David S. Miller
d5ea655376 [COMPAT]: Add ext3 ioctl translations.
So things like on-line resizing et al. work.

Based almost entirely upon a patch by Guido Gnther <agx@sigxcpu.org>

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-11-17 15:04:34 -08:00
Steve French
0f2b27c438 [CIFS] Fix sparse warnings on smb bcc (byte count)
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-16 14:25:50 -08:00
David S. Miller
6e87abd0b8 [DVB]: Add compat ioctl handling.
Based upon a patch by Guido Guenther <agx@sigxcpu.org>.

Some of these ioctls had embedded time_t objects
or pointers, so needed translation.

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-11-16 00:52:57 -08:00
Steve French
ff7feac963 [CIFS] Fix endian errors (setfacl/getfacl failures) in handling ACLs
(and a ppc64 compiler warning)

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-15 16:45:16 -08:00
Steve French
d6e2f2a4c8 [CIFS] Recognize properly symlinks and char/blk devices (not just FIFOs)
created by SFU (part 1 of 2).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-15 16:43:39 -08:00
Steve French
7b0a65f992 Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2005-11-13 20:28:58 -08:00
Johann Lombardi
ec63f22dc3 [PATCH] ext2: remove duplicate newlines in ext2_fill_super
ext2_warning() already adds a newline.

Signed-off-by: Johann Lombardi <johann.lombardi@bull.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:17 -08:00
Zach Brown
d00689af6b [PATCH] aio: replace locking comments with assert_spin_locked()
aio: replace locking comments with assert_spin_locked()

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:16 -08:00
Zach Brown
20dcae3243 [PATCH] aio: remove kioctx from mm_struct
Sync iocbs have a life cycle that don't need a kioctx.  Their retrying, if
any, is done in the context of their owner who has allocated them on the
stack.

The sole user of a sync iocb's ctx reference was aio_complete() checking for
an elevated iocb ref count that could never happen.  No path which grabs an
iocb ref has access to sync iocbs.

If we were to implement sync iocb cancelation it would be done by the owner of
the iocb using its on-stack reference.

Removing this chunk from aio_complete allows us to remove the entire kioctx
instance from mm_struct, reducing its size by a third.  On a i386 testing box
the slab size went from 768 to 504 bytes and from 5 to 8 per page.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:16 -08:00
Luiz Fernando Capitulino
0f5c79f292 [PATCH] Fix sparse warning in proc/task_mmu.c
fs/proc/task_mmu.c:198:33: warning: Using plain integer as NULL pointer

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:15 -08:00
Denis Lunev
ab4eb43ce7 [PATCH] ext3: journal handling on error path in ext3_journalled_writepage()
This patch fixes lost referrence on ext3 current handle in
ext3_journalled_writepage().

Signed-Off-By: Denis Lunev <den@sw.ru>
Cc: Kirill Korotaev <dev@sw.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:15 -08:00
Linus Torvalds
41866a56cc Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6 2005-11-13 12:30:14 -08:00
Thomas Gleixner
5b9d1f19a7 [JFFS2] Remove broken and useless debug code
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-13 19:33:24 +01:00
Chris Wright
f3a9388e4e [PATCH] VFS: local denial-of-service with file leases
Remove time_out_leases() printk that's easily triggered by users.

 Signed-off-by: Chris Wright <chrisw@osdl.org>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2005-11-13 12:29:58 -05:00
J. Bruce Fields
dc15ae14e9 [PATCH] VFS: Fix memory leak with file leases
The patch
 http://linux.bkbits.net:8080/linux-2.6/diffs/fs/locks.c@1.70??nav=index.html
 introduced a pretty nasty memory leak in the lease code. When freeing
 the lease, the code in locks_delete_lock() will correctly clean up
 the fasync queue, but when we return to fcntl_setlease(), the freed
 fasync entry will be reinstated.

 This patch ensures that we skip the call to fasync_helper() when we're
 freeing up the lease.

 Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2005-11-13 12:29:54 -05:00
Steve French
1b98a8221e Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2005-11-12 19:53:33 -08:00
Linus Torvalds
63f45b8094 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2005-11-11 16:29:22 -08:00
Steve French
e89dc92096 [CIFS] Cleanup sparse warnings for unicode little endian casts
Following Shaggy's suggestion, do a better job on the unicode string
handling routines in cifs in specifying that the wchar_t are really
little endian widechars (__le16).

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-11 15:18:19 -08:00
Steve French
8b94bcb923 [CIFS] Fix CIFS "nobrl" mount option so does not disable sending brl requests
for all mounts just that particular mount.

Found by Arjan Vand de Ven

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-11 11:41:00 -08:00
Steve French
1b397f4f1c [CIFS] Fix spaces in cifs kconfig entry
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-10 19:36:39 -08:00
Steve French
69114089b7 [CIFS] Reduce sparse endian warnings
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-10 19:28:44 -08:00
Steve French
3c50c61826 [CIFS] Update CIFS change log
Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-10 17:31:33 -08:00
Steve French
a2653ebab3 [CIFS] Reserve upcall IDX value for CIFS with connector header and add
Kconfig option for CIFS upcall.

Signed-off-by: Steve French <sfrench@us.ibm.com>
2005-11-10 15:33:38 -08:00
Steve French
7b7abfe3dd 2005-11-09 15:21:09 -08:00
Steve French
e82b3aec8d Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2005-11-09 14:33:22 -08:00
Linus Torvalds
ad8f76be48 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6 2005-11-09 13:47:34 -08:00