31 Dec, 2008

1 commit


14 Nov, 2008

2 commits

  • Conflicts:
    security/keys/internal.h
    security/keys/process_keys.c
    security/keys/request_key.c

    Fixed conflicts above by using the non 'tsk' versions.

    Signed-off-by: James Morris

    James Morris
     
  • Wrap access to task credentials so that they can be separated more easily from
    the task_struct during the introduction of COW creds.

    Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

    Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
    sense to use RCU directly rather than a convenient wrapper; these will be
    addressed by later patches.

    Signed-off-by: David Howells
    Reviewed-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: OGAWA Hirofumi
    Signed-off-by: James Morris

    David Howells
     

12 Nov, 2008

1 commit


07 Nov, 2008

9 commits

  • i_pos is 64bits value, hence it's not atomic to update.

    Important place is fat_write_inode() only, other places without lock
    are just for printk().

    This adds lock for "BITS_PER_LONG == 32" kernel.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • mmu_private is 64bits value, hence it's not atomic to update.

    So, the access rule for mmu_private is we must hold ->i_mutex. But,
    fat_get_block() path doesn't follow the rule on non-allocation path.

    This fixes by using i_size instead if non-allocation path.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • fat_get_cluster() assumes the requested blocknr isn't truncated during
    read. _fat_bmap() doesn't follow this rule.

    This protects it by ->i_mutex.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • FAT has the ATTR_RO (read-only) attribute. But on Windows, the ATTR_RO
    of the directory will be just ignored actually, and is used by only
    applications as flag. E.g. it's setted for the customized folder by
    Explorer.

    http://msdn2.microsoft.com/en-us/library/aa969337.aspx

    This adds "rodir" option. If user specified it, ATTR_RO is used as
    read-only flag even if it's the directory. Otherwise, inode->i_mode
    is not used to hold ATTR_RO (i.e. fat_mode_can_save_ro() returns 0).

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This adds three helpers:

    fat_make_attrs() - makes FAT attributes from inode.
    fat_make_mode() - makes mode_t from FAT attributes.
    fat_save_attrs() - saves FAT attributes to inode.

    Then this replaces: MSDOS_MKMODE() by fat_make_mode(), fat_attr() by
    fat_make_attrs(), ->i_attrs = attr & ATTR_UNUSED by fat_save_attrs().
    And for root inode, those is used with ATTR_DIR instead of bogus
    ATTR_NONE.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Use fat_detach() instead of opencoding it.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • fat_hash() is using the algorithm known as bad. Instead of it, this
    uses hash_32(). The following is the summary of test.

    old hash:
    hash func (1000 times): 33489 cycles
    total inodes in hash table: 70926
    largest bucket contains: 696
    smallest bucket contains: 54

    new hash:
    hash func (1000 times): 33129 cycles
    total inodes in hash table: 70926
    largest bucket contains: 315
    smallest bucket contains: 236

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This cleans date_dos2unix()/fat_date_unix2dos() up. New code should be
    much more readable.

    And this fixes those old functions. Those doesn't handle 2100
    correctly. 2100 isn't leap year, but old one handles it as leap year.
    Also, with this, centi sec is handled and is fixed.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • This splits __KERNEL__ stuff in include/msdos_fs.h into fs/fat/fat.h.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

31 Oct, 2008

1 commit

  • Nothing uses prepare_write or commit_write. Remove them from the tree
    completely.

    [akpm@linux-foundation.org: schedule simple_prepare_write() for unexporting]
    Signed-off-by: Nick Piggin
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

23 Oct, 2008

1 commit


14 Oct, 2008

1 commit

  • This is a much better version of a previous patch to make the parser
    tables constant. Rather than changing the typedef, we put the "const" in
    all the various places where its required, allowing the __initconst
    exception for nfsroot which was the cause of the previous trouble.

    This was posted for review some time ago and I believe its been in -mm
    since then.

    Signed-off-by: Steven Whitehouse
    Cc: Alexander Viro
    Signed-off-by: Linus Torvalds

    Steven Whitehouse
     

20 Aug, 2008

1 commit

  • There was another FAT BKL conversion deadlock reported by Bart
    Trojanowski due to the BKL being used as a recursive lock by FAT, which
    was missed because it only triggers with 'sync' (or 'dirsync') mounts.

    The recursion worked for the BKL, but after the conversion to lock_super
    (which uses a mutex), it just deadlocks.

    Thanks to Bart for debugging this and testing the fix. The lock
    debugging information from the original report:

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.27-rc3-bisect-00448-ga7f5aaf #16
    ---------------------------------------------
    mv/4020 is trying to acquire lock:
    (&type->s_lock_key#9){--..}, at: [] lock_super+0x1e/0x20

    but task is already holding lock:
    (&type->s_lock_key#9){--..}, at: [] lock_super+0x1e/0x20

    other info that might help us debug this:
    3 locks held by mv/4020:
    #0: (&sb->s_type->i_mutex_key#9/1){--..}, at: [] do_unlinkat+0x66/0x140
    #1: (&sb->s_type->i_mutex_key#9){--..}, at: [] vfs_unlink+0x84/0x110
    #2: (&type->s_lock_key#9){--..}, at: [] lock_super+0x1e/0x20

    stack backtrace:
    Pid: 4020, comm: mv Not tainted 2.6.27-rc3-bisect-00448-ga7f5aaf #16
    [] validate_chain+0x984/0xea0
    [] ? native_sched_clock+0x0/0xf0
    [] __lock_acquire+0x2ec/0x9b0
    [] lock_acquire+0x6f/0x90
    [] ? lock_super+0x1e/0x20
    [] mutex_lock_nested+0xad/0x300
    [] ? lock_super+0x1e/0x20
    [] ? lock_super+0x1e/0x20
    [] lock_super+0x1e/0x20
    [] fat_write_inode+0x60/0x2b0 [fat]
    [] ? _spin_unlock_irqrestore+0x48/0x80
    [] ? fat_sync_inode+0x3/0x20 [fat]
    [] fat_sync_inode+0x12/0x20 [fat]
    [] fat_remove_entries+0xbe/0x120 [fat]
    [] vfat_unlink+0x5f/0x90 [vfat]
    [] ? vfat_unlink+0x0/0x90 [vfat]
    [] vfs_unlink+0x98/0x110
    [] do_unlinkat+0x130/0x140
    [] ? audit_syscall_entry+0x105/0x150
    [] sys_unlinkat+0x3b/0x40
    [] sysenter_do_call+0x12/0x3f
    =======================

    where the deadlock is due to the nesting of lock_super from vfat_unlink
    to fat_write_inode:

    - do_unlinkat
    - vfs_unlink
    - vfat_unlink
    * lock_super
    - fat_remove_entries
    - fat_sync_inode
    - fat_write_inode
    * lock_super

    and the fix is to simply remove the use of lock_super() in fat_write_inode.

    The lock_super() there had been just an automatic conversion of the
    kernel lock to the superblock lock, but no locking was actually needed
    there, since the code in fat_write_inode already protected all relevant
    accesses with a spinlock (sbi->inode_hash_lock to be exact). The only
    code inside the BKL (and thus the superblock lock) was accesses tp local
    variables or calls to functions that have long been SMP-safe (i.e.
    sb_bread, mark_buffe_dirty and brlese).

    Bart reports:
    "Looks good. I ran 10 parallel processes creating 1M files truncating
    them, writing to them again and then deleting them. This patch fixes
    the issue I ran into.

    Signed-off-by: Bart Trojanowski "

    Reported-and-tested-by: Bart Trojanowski
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

27 Jul, 2008

1 commit

  • Kmem cache passed to constructor is only needed for constructors that are
    themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
    passed kmem cache in non-trivial way, so pass only pointer to object.

    Non-trivial places are:
    arch/powerpc/mm/init_64.c
    arch/powerpc/mm/hugetlbpage.c

    This is flag day, yes.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Cc: Jon Tollefson
    Cc: Nick Piggin
    Cc: Matt Mackall
    [akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
    [akpm@linux-foundation.org: fix mm/slab.c]
    [akpm@linux-foundation.org: fix ubifs]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

26 Jul, 2008

2 commits

  • Provide a new mount option ("tz=UTC") for DOS (vfat/msdos) filesystems,
    allowing timestamps to be in coordinated universal time (UTC) rather than
    local time in applications where doing this is advantageous.

    In particular, portable devices that use fat/vfat (such as digital
    cameras) can benefit from using UTC in their internal clocks, thus
    avoiding daylight saving time errors and general time ambiguity issues.
    The user of the device does not have to worry about changing the time when
    moving from place or when daylight saving changes.

    The new mount option, when set, disables the counter-adjustment that Linux
    currently makes to FAT timestamp info in anticipation of the normal
    userspace time zone correction. When used in this new mode, all daylight
    saving time and time zone handling is done in userspace as is normal for
    many other filesystems (like ext3). The default mode, which remains
    unchanged, is still appropriate when mounting volumes written in Windows
    (because of its use of local time).

    I originally based this patch on one submitted last year by Paul Collins,
    but I updated it to work with current source and changed variable/option
    naming. Ogawa Hirofumi (who maintains these filesystems) and I discussed
    this patch at length on lkml, and he suggested using the option name in
    the attached version of the patch. Barry Bouwsma pointed out a good
    addition to the patch as well.

    Signed-off-by: Joe Peterson
    Signed-off-by: Paul Collins
    Acked-by: OGAWA Hirofumi
    Cc: Barry Bouwsma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Peterson
     
  • Current parse_options() exits too early. We need to run the code of
    bottom in this function even if users doesn't specify options.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

21 Jun, 2008

1 commit

  • This replaces the use of the BKL in the FAT family of filesystems with the
    existing superblock lock instead.

    The code already appears to do mostly proper locking with its own private
    spinlocks (and mutexes), but while the BKL could possibly have been
    dropped entirely, converting it to use the superblock lock (which is just
    a regular mutex) is the conservative thing to do.

    As a per-filesystem mutex, it not only won't have any of the possible
    latency issues related to the BKL, but the lock is obviously private to
    the particular filesystem instance and will thus not cause problems for
    entirely unrelated users like the BKL can.

    Signed-off-by: Linus Torvalds
    Cc: OGAWA Hirofumi
    Signed-off-by: Jonathan Corbet

    Linus Torvalds
     

29 Apr, 2008

1 commit


28 Apr, 2008

5 commits

  • Annoying gcc warning:

    fs/fat/inode.c: In function 'fat_fill_super':
    fs/fat/inode.c:1222: warning: comparison is always false due to limited range of data type

    Change it to compare with 4K instead of PAGE_CACHE_SIZE, as suggested
    by OGAWA-san.

    [FAT spec says: logical_sector_size should be 512, 1024, 2048 4096]
    So, at least for now, we limit it to 4096.

    Signed-off-by: Olof Johansson
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • The on-disk media specification field in FAT is only 8-bits, so testing for

    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Currently, free_clusters is not updated until it is trusted, because
    Windows doesn't update it correctly.

    But if user is using FAT driver of Linux, it updates free_clusters
    correctly. Instead, this updates it even if it's untrusted, so if
    free_clustes is correct, now keep correct value.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • Normally utime(2) checks current process is owner of the file, or it
    has CAP_FOWNER capability. But FAT filesystem doesn't have uid/gid as
    on disk info, so normal check is too unflexible.

    With this option you can relax it.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • FAT doesn't need to check bad inode anymore.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

09 Feb, 2008

1 commit


08 Feb, 2008

2 commits


07 Feb, 2008

1 commit

  • This makes sure printk format strings contain no more than a single line.

    Signed-off-by: Vegard Nossum
    [the message was tweaked.]
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vegard Nossum
     

22 Oct, 2007

2 commits

  • Now that nfsd has stopped writing to the find_exported_dentry member we an
    mark the export_operations const

    Signed-off-by: Christoph Hellwig
    Cc: Neil Brown
    Cc: "J. Bruce Fields"
    Cc:
    Cc: Dave Kleikamp
    Cc: Anton Altaparmakov
    Cc: David Chinner
    Cc: Timothy Shimmin
    Cc: OGAWA Hirofumi
    Cc: Hugh Dickins
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Cc: "Vladimir V. Saveliev"
    Cc: Steven Whitehouse
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Very little changes here, fat had a mostly no op decode_fh before and does not
    store any parent information.

    Signed-off-by: Christoph Hellwig
    Cc: Neil Brown
    Cc: "J. Bruce Fields"
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Oct, 2007

2 commits

  • Slab constructors currently have a flags parameter that is never used. And
    the order of the arguments is opposite to other slab functions. The object
    pointer is placed before the kmem_cache pointer.

    Convert

    ctor(void *object, struct kmem_cache *s, unsigned long flags)

    to

    ctor(struct kmem_cache *s, void *object)

    throughout the kernel

    [akpm@linux-foundation.org: coupla fixes]
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Signed-off-by: Nick Piggin
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

18 Jul, 2007

1 commit

  • currently the export_operation structure and helpers related to it are in
    fs.h. fs.h is already far too large and there are very few places needing the
    export bits, so split them off into a separate header.

    [akpm@linux-foundation.org: fix cifs build]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Neil Brown
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Jul, 2007

1 commit

  • This patch fixes the following warnings.

    fs/fat/dir.c: In function 'fat_parse_long':
    include/linux/msdos_fs.h:294: warning: array subscript is above array bounds
    include/linux/msdos_fs.h:295: warning: array subscript is above array bounds
    include/linux/msdos_fs.h:295: warning: array subscript is above array bounds

    The ->name is defined as "name[8], ext[3]", but fat_checksum() uses
    those as name[11]. There is no actual problem, but it's not a good manner.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

17 May, 2007

1 commit

  • SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

    Signed-off-by: Christoph Lameter
    Cc: David Howells
    Cc: Jens Axboe
    Cc: Steven French
    Cc: Michael Halcrow
    Cc: OGAWA Hirofumi
    Cc: Miklos Szeredi
    Cc: Steven Whitehouse
    Cc: Roman Zippel
    Cc: David Woodhouse
    Cc: Dave Kleikamp
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Anton Altaparmakov
    Cc: Mark Fasheh
    Cc: Paul Mackerras
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: David Chinner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

09 May, 2007

1 commit

  • It seems that the recent Windows changed specification, and it's
    undocumented. Windows doesn't update ->free_clusters correctly.

    This patch doesn't use ->free_clusters by default. (instead, add "usefree"
    for forcing to use it)

    Signed-off-by: OGAWA Hirofumi
    Cc: Juergen Beisert
    Cc: Andreas Schwab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi