1. 09 2月, 2008 24 次提交
  2. 08 2月, 2008 16 次提交
    • M
      dm ioctl: move compat code · 76c072b4
      Milan Broz 提交于
      Move compat_ioctl handling into dm-ioctl.c.
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      76c072b4
    • J
      SUNRPC xptrdma: simplify build configuration · 3211e4eb
      James Lentini 提交于
      
      Trond and Bruce,
      
      This is a patch for 2.6.25. This is the same version that was sent out
      on December 12 for review (no comments to date).
      
      To simplify the RPC/RDMA client and server build configuration, make
      SUNRPC_XPRT_RDMA a hidden config option that continues to depend on
      SUNRPC and INFINIBAND. The value of SUNRPC_XPRT_RDMA will be:
      
       - N if either SUNRPC or INFINIBAND are N
       - M if both SUNRPC and INFINIBAND are on (M or Y) and at least one is M
       - Y if both SUNRPC and INFINIBAND are Y
      
      In 2.6.25, all of the RPC/RDMA related files are grouped in
      net/sunrpc/xprtrdma and the net/sunrpc/xprtrdma/Makefile builds both
      the client and server RPC/RDMA support using this config option.
      Signed-off-by: NJames Lentini <jlentini@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      3211e4eb
    • T
      NFS: Fix a potential file corruption issue when writing · 5d47a356
      Trond Myklebust 提交于
      If the inode is flagged as having an invalid mapping, then we can't rely on
      the PageUptodate() flag. Ensure that we don't use the "anti-fragmentation"
      write optimisation in nfs_updatepage(), since that will cause NFS to write
      out areas of the page that are no longer guaranteed to be up to date.
      
      A potential corruption could occur in the following scenario:
      
      client 1			client 2
      ===============			===============
      				fd=open("f",O_CREAT|O_WRONLY,0644);
      				write(fd,"fubar\n",6);	// cache last page
      				close(fd);
      fd=open("f",O_WRONLY|O_APPEND);
      write(fd,"foo\n",4);
      close(fd);
      
      				fd=open("f",O_WRONLY|O_APPEND);
      				write(fd,"bar\n",4);
      				close(fd);
      -----
      The bug may lead to the file "f" reading 'fubar\n\0\0\0\nbar\n' because
      client 2 does not update the cached page after re-opening the file for
      write. Instead it keeps it marked as PageUptodate() until someone calls
      invaldate_inode_pages2() (typically by calling read()).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5d47a356
    • A
      BKL-removal: Implement a compat_ioctl handler for JFS · ef1fc2f0
      Andi Kleen 提交于
      The ioctls were already compatible except for the actual values so this
      was fairly easy to do.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      ef1fc2f0
    • A
      BKL-removal: Use unlocked_ioctl for jfs · baab81fa
      Andi Kleen 提交于
      Convert jfs_ioctl over to not use the BKL. The only potential race
      I could see was with two ioctls in parallel changing the flags
      and losing the updates. Use the i_mutex to protect against this.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      baab81fa
    • G
      sysfs: remove BUG_ON() from sysfs_remove_group() · 969affd2
      Greg Kroah-Hartman 提交于
      It's possible that the caller of sysfs_remove_group messed up and passed in an attribute group that was not really registered to this kobject.  But don't panic for such a foolish error, spit out a warning about what happened, and continue on our way safely.
      
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      969affd2
    • G
      Block: Fix whole_disk attribute bug · f4a00a2c
      Greg Kroah-Hartman 提交于
      The "whole_disk" attribute was not properly converted in the block
      device conversion earlier, and if the file is read, bad things can
      happen.  This patch fixes this, making the attribute an empty one,
      preserving the original functionality.
      
      Many thanks to David Miller for finding this, and pointing me in the
      proper place within the block code to look.
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f4a00a2c
    • H
      Sanitize the type of struct user.u_ar0 · 6e16d89b
      H. Peter Anvin 提交于
      struct user.u_ar0 is defined to contain a pointer offset on all
      architectures in which it is defined (all architectures which define an
      a.out format except SPARC.) However, it has a pointer type in the headers,
      which is pointless -- <asm/user.h> is not exported to userspace, and it
      just makes the code messy.
      
      Redefine the field as "unsigned long" (which is the same size as a pointer
      on all Linux architectures) and change the setting code to user offsetof()
      instead of hand-coded arithmetic.
      
      Cc: Linux Arch Mailing List <linux-arch@vger.kernel.org>
      Cc: Bryan Wu <bryan.wu@analog.com>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Lennert Buytenhek <kernel@wantstofly.org>
      Cc: Håvard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6e16d89b
    • D
      iget: remove iget() and the read_inode() super op as being obsolete · 12debc42
      David Howells 提交于
      Remove the old iget() call and the read_inode() superblock operation it uses
      as these are really obsolete, and the use of read_inode() does not produce
      proper error handling (no distinction between ENOMEM and EIO when marking an
      inode bad).
      
      Furthermore, this removes the temptation to use iget() to find an inode by
      number in a filesystem from code outside that filesystem.
      
      iget_locked() should be used instead.  A new function is added in an earlier
      patch (iget_failed) that is to be called to mark an inode as bad, unlock it
      and release it should the get routine fail.  Mark iget() and read_inode() as
      being obsolete and remove references to them from the documentation.
      
      Typically a filesystem will be modified such that the read_inode function
      becomes an internal iget function, for example the following:
      
      	void thingyfs_read_inode(struct inode *inode)
      	{
      		...
      	}
      
      would be changed into something like:
      
      	struct inode *thingyfs_iget(struct super_block *sp, unsigned long ino)
      	{
      		struct inode *inode;
      		int ret;
      
      		inode = iget_locked(sb, ino);
      		if (!inode)
      			return ERR_PTR(-ENOMEM);
      		if (!(inode->i_state & I_NEW))
      			return inode;
      
      		...
      		unlock_new_inode(inode);
      		return inode;
      	error:
      		iget_failed(inode);
      		return ERR_PTR(ret);
      	}
      
      and then thingyfs_iget() would be called rather than iget(), for example:
      
      	ret = -EINVAL;
      	inode = iget(sb, ino);
      	if (!inode || is_bad_inode(inode))
      		goto error;
      
      becomes:
      
      	inode = thingyfs_iget(sb, ino);
      	if (IS_ERR(inode)) {
      		ret = PTR_ERR(inode);
      		goto error;
      	}
      
      Note that is_bad_inode() does not need to be called.  The error returned by
      thingyfs_iget() should render it unnecessary.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      12debc42
    • D
      iget: stop HPPFS from using iget() and read_inode() · 755aedc1
      David Howells 提交于
      Stop the HPPFS filesystem from using iget() and read_inode().  Provide an
      hppfs_iget(), and call that instead of iget().  hppfs_iget() then uses
      iget_locked() directly and returns a proper error code instead of an inode in
      the event of an error.
      
      hppfs_fill_sb_common() returns any error incurred when getting the root inode
      instead of EINVAL.
      
      Note that the contents of hppfs_kern.c need to be examined:
      
       (*) The HPPFS inode retains a pointer to the proc dentry it is shadowing, but
           whilst it does appear to retain a reference to it, it doesn't appear to
           destroy the reference if the inode goes away.
      
       (*) hppfs_iget() should perhaps subsume init_inode() and hppfs_read_inode().
      
       (*) It would appear that all hppfs inodes are the same inode because iget()
           was being called with inode number 0, which forms the lookup key.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      755aedc1
    • D
      iget: stop HOSTFS from using iget() and read_inode() · 0a370e5d
      David Howells 提交于
      Stop the HOSTFS filesystem from using iget() and read_inode().  Provide
      hostfs_iget(), and call that instead of iget().  hostfs_iget() then uses
      iget_locked() directly and returns a proper error code instead of an inode in
      the event of an error.
      
      hostfs_fill_sb_common() returns any error incurred when getting the root inode
      instead of EINVAL.
      
      Note that the contents of hostfs_kern.c need to be examined:
      
       (*) hostfs_iget() should perhaps subsume init_inode() and hostfs_read_inode().
      
       (*) It would appear that all hostfs inodes are the same inode because iget()
           was being called with inode number 0 - which forms the lookup key.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0a370e5d
    • D
      iget: stop OPENPROMFS from using iget() and read_inode() · b88a27ed
      David Howells 提交于
      Stop the OPENPROMFS filesystem from using iget() and read_inode().  Replace
      openpromfs_read_inode() with openpromfs_iget(), and call that instead of
      iget().  openpromfs_iget() then uses iget_locked() directly and returns a
      proper error code instead of an inode in the event of an error.
      
      openpromfs_fill_super() returns any error incurred when getting the root inode
      instead of ENOMEM (not that it currently incurs any other error).
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b88a27ed
    • D
      iget: stop UFS from using iget() and read_inode() · b55c460d
      David Howells 提交于
      Stop the UFS filesystem from using iget() and read_inode().  Replace
      ufs_read_inode() with ufs_iget(), and call that instead of iget().  ufs_iget()
      then uses iget_locked() directly and returns a proper error code instead of an
      inode in the event of an error.
      
      ufs_fill_super() returns any error incurred when getting the root inode
      instead of EINVAL.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Evgeniy Dushistov <dushistov@mail.ru>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b55c460d
    • D
      iget: stop the SYSV filesystem from using iget() and read_inode() · b8e1343f
      David Howells 提交于
      Stop the SYSV filesystem from using iget() and read_inode().  Replace
      sysv_read_inode() with sysv_iget(), and call that instead of iget().
      sysv_iget() then uses iget_locked() directly and returns a proper error code
      instead of an inode in the event of an error.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b8e1343f
    • D
      iget: stop ROMFS from using iget() and read_inode() · 78cc9120
      David Howells 提交于
      Stop the ROMFS filesystem from using iget() and read_inode().  Replace
      romfs_read_inode() with romfs_iget(), and call that instead of iget().
      romfs_iget() then uses iget_locked() directly and returns a proper error code
      instead of an inode in the event of an error.
      
      romfs_fill_super() returns any error incurred when getting the root inode
      instead of EINVAL.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      78cc9120
    • D
      iget: stop QNX4 from using iget() and read_inode() · 2b7e5bcb
      David Howells 提交于
      Stop the QNX4 filesystem from using iget() and read_inode().  Replace
      qnx4_read_inode() with qnx4_iget(), and call that instead of iget().
      qnx4_iget() then uses iget_locked() directly and returns a proper error code
      instead of an inode in the event of an error.
      
      qnx4_fill_super() returns any error incurred when getting the root inode
      instead of EINVAL.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Anders Larsen <al@alarsen.net>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2b7e5bcb