08 Feb, 2008

40 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
    BKL-removal: Implement a compat_ioctl handler for JFS
    BKL-removal: Use unlocked_ioctl for jfs

    Linus Torvalds
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
    ocfs2: Negotiate locking protocol versions.

    Linus Torvalds
     
  • The ioctls were already compatible except for the actual values so this
    was fairly easy to do.

    Signed-off-by: Andi Kleen
    Signed-off-by: Dave Kleikamp

    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: Andi Kleen
    Signed-off-by: Dave Kleikamp

    Andi Kleen
     
  • 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
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    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: David S. Miller
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • * git://git.infradead.org/mtd-2.6: (120 commits)
    [MTD] Fix mtdoops.c compilation
    [MTD] [NOR] fix startup lock when using multiple nor flash chips
    [MTD] [DOC200x] eccbuf is statically defined and always evaluate to true
    [MTD] Fix maps/physmap.c compilation with CONFIG_PM
    [MTD] onenand: Add panic_write function to the onenand driver
    [MTD] mtdoops: Use the panic_write function when present
    [MTD] Add mtd panic_write function pointer
    [MTD] [NAND] Freescale enhanced Local Bus Controller FCM NAND support.
    [MTD] physmap.c: Add support for multiple resources
    [MTD] [NAND] Fix misparenthesization introduced by commit 78b65179...
    [MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytes
    [MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driver
    [MTD] [NAND] Remove unused variable in plat_nand_remove
    [MTD] Unlocking all Intel flash that is locked on power up.
    [MTD] [NAND] at91_nand: Make mtdparts option can override board info
    [MTD] mtdoops: Various minor cleanups
    [MTD] mtdoops: Ensure sequential write to the buffer
    [MTD] mtdoops: Perform write operations in a workqueue
    [MTD] mtdoops: Add further error return code checking
    [MTD] [NOR] Test devtype, not definition in flash_probe(), drivers/mtd/devices/lart.c
    ...

    Linus Torvalds
     
  • 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 -- 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
    Cc: Bryan Wu
    Cc: Roman Zippel
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Lennert Buytenhek
    Cc: Håvard Skinnemoen
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Tony Luck
    Cc: Hirokazu Takata
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H. Peter Anvin
     
  • 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: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Cc: Jeff Dike
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Cc: "David S. Miller"
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Cc: Evgeniy Dushistov
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Howells
    Cc: Anders Larsen
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the PROCFS filesystem from using iget() and read_inode(). Merge
    procfs_read_inode() into procfs_get_inode(), and have that call iget_locked()
    instead of iget().

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Cc: "Eric W. Biederman"
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the MINIX filesystem from using iget() and read_inode(). Replace
    minix_read_inode() with minix_iget(), and call that instead of iget().
    minix_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    minix_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the JFS filesystem from using iget() and read_inode(). Replace
    jfs_read_inode() with jfs_iget(), and call that instead of iget(). jfs_iget()
    then uses iget_locked() directly and returns a proper error code instead of an
    inode in the event of an error.

    jfs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    Signed-off-by: David Howells
    Acked-by: Dave Kleikamp
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the JFFS2 filesystem from using iget() and read_inode(). Replace
    jffs2_read_inode() with jffs2_iget(), and call that instead of iget().
    jffs2_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    jffs2_do_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    Signed-off-by: David Howells
    Cc: David Woodhouse
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the ISOFS filesystem from using read_inode(). Make isofs_read_inode()
    return an error code, and make isofs_iget() pass it on.

    Signed-off-by: David Howells
    Cc: Jan Kara
    Acked-by: Christoph Hellwig
    Cc: "Dave Young"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the HFSPLUS filesystem from using iget() and read_inode(). Replace
    hfsplus_read_inode() with hfsplus_iget(), and call that instead of iget().
    hfsplus_iget() then uses iget_locked() directly and returns a proper error
    code instead of an inode in the event of an error.

    hfsplus_fill_super() returns any error incurred when getting the root inode.

    Signed-off-by: David Howells
    Cc: Roman Zippel
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the FUSE filesystem from using read_inode(), which it doesn't use anyway.

    Signed-off-by: David Howells
    Cc: Miklos Szeredi
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the FreeVXFS filesystem from using iget() and read_inode(). Replace
    vxfs_read_inode() with vxfs_iget(), and call that instead of iget().
    vxfs_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    vxfs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the FAT filesystem from using iget() and read_inode(). Replace the call
    to iget() with a call to ilookup().

    Signed-off-by: David Howells
    Cc: OGAWA Hirofumi
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the EXT4 filesystem from using iget() and read_inode(). Replace
    ext4_read_inode() with ext4_iget(), and call that instead of iget().
    ext4_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    ext4_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    Signed-off-by: David Howells
    Acked-by: "Theodore Ts'o"
    Acked-by: Jan Kara
    Cc:
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the EXT3 filesystem from using iget() and read_inode(). Replace
    ext3_read_inode() with ext3_iget(), and call that instead of iget().
    ext3_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    ext3_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: "Theodore Ts'o"
    Acked-by: Jan Kara
    Cc:
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the EXT2 filesystem from using iget() and read_inode(). Replace
    ext2_read_inode() with ext2_iget(), and call that instead of iget().
    ext2_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    ext2_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: "Theodore Ts'o"
    Cc:
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the EFS filesystem from using iget() and read_inode(). Replace
    efs_read_inode() with efs_iget(), and call that instead of iget(). efs_iget()
    then uses iget_locked() directly and returns a proper error code instead of an
    inode in the event of an error.

    efs_fill_super() returns any error incurred when getting the root inode
    instead of EACCES.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the CIFS filesystem from using iget() and read_inode(). Replace
    cifs_read_inode() with cifs_iget(), and call that instead of iget().
    cifs_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    cifs_read_super() now returns any error incurred when getting the root inode
    instead of ENOMEM.

    cifs_iget() needs examining. The comment "can not call macro FreeXid here
    since in a void func" is no longer true.

    Signed-off-by: David Howells
    Cc: Steven French
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the BFS filesystem from using iget() and read_inode(). Replace
    bfs_read_inode() with bfs_iget(), and call that instead of iget(). bfs_iget()
    then uses iget_locked() directly and returns a proper error code instead of an
    inode in the event of an error.

    bfs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [kamalesh@linux.vnet.ibm.com: build fix]
    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the BEFS filesystem from using iget() and read_inode(). Replace
    befs_read_inode() with befs_iget(), and call that instead of iget().
    befs_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    befs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    Signed-off-by: David Howells
    Acked-by: Will Dyson
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the autofs filesystem from using iget() and read_inode(). Replace
    autofs_read_inode() with autofs_iget(), and call that instead of iget().
    autofs_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    Signed-off-by: David Howells
    Cc: Ian Kent
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Stop the AFFS filesystem from using iget() and read_inode(). Replace
    affs_read_inode() with affs_iget(), and call that instead of iget().
    affs_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    affs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Cc: Roman Zippel
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Use iget_failed() in GFS2 to kill a failed inode.

    Signed-off-by: David Howells
    Cc: Steven Whitehouse
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Use iget_failed() in AFS to kill a failed inode.

    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Introduce a function to register failure in an inode construction path. This
    includes marking the inode under construction as bad, unlocking it and
    releasing it.

    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Convert instances of ERR_PTR(PTR_ERR(p)) to ERR_CAST(p) using:

    perl -spi -e 's/ERR_PTR[(]PTR_ERR[(](.*)[)][)]/ERR_CAST(\1)/' `grep -rl 'ERR_PTR[(]*PTR_ERR' fs crypto net security`

    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • - move minixfs and ROMfs to the Miscellaneous filesystems menu
    - move DNOTIFY config symbol so that it is adjacent to INOTIFY
    instead of being split by the QUOTA config options
    - add some 'endif' annotations
    - remove some whitespace (extra blank lines)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Factor out file-specific ioctl code into smaller helper functions, away from
    file_ioctl(). This helps code readability and also reduces indentation inside
    case statements.

    Signed-off-by: Erez Zadok
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Erez Zadok