1. 24 9月, 2009 1 次提交
    • T
      fs: Make unload_nls() NULL pointer safe · 6d729e44
      Thomas Gleixner 提交于
      Most call sites of unload_nls() do:
      	if (nls)
      		unload_nls(nls);
      
      Check the pointer inside unload_nls() like we do in kfree() and
      simplify the call sites.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steve French <sfrench@us.ibm.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6d729e44
  2. 20 9月, 2009 1 次提交
    • O
      fat: Check s_dirt in fat_sync_fs() · ed248b29
      OGAWA Hirofumi 提交于
      If we didn't check sb->s_dirt, it will update the FSINFO
      unconditionally. It will reduce the filetime of flash base device.
      
      So, this checks sb->s_dirt. sb->s_dirt is racy, however FSINFO is just
      hint. So even if there is race, and we hit it, it would not become big
      problem.
      
      And this also is as workaround of suspend problem.
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      ed248b29
  3. 01 8月, 2009 1 次提交
  4. 20 6月, 2009 1 次提交
  5. 12 6月, 2009 5 次提交
    • C
      fat: add ->sync_fs · f83d6d46
      Christoph Hellwig 提交于
      Add a ->sync_fs method for data integrity syncs.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f83d6d46
    • A
      Sanitize ->fsync() for FAT · b522412a
      Al Viro 提交于
      * mark directory data blocks as assoc. metadata
      * add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
      * now ->fsync() is trivial both for files and directories
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      b522412a
    • C
      ->write_super lock_super pushdown · ebc1ac16
      Christoph Hellwig 提交于
      Push down lock_super into ->write_super instances and remove it from the
      caller.
      
      Following filesystem don't need ->s_lock in ->write_super and are skipped:
      
       * bfs, nilfs2 - no other uses of s_lock and have internal locks in
      	->write_super
       * ext2 - uses BKL in ext2_write_super and has internal calls without s_lock
       * reiserfs - no other uses of s_lock as has reiserfs_write_lock (BKL) in
       	->write_super
       * xfs - no other uses of s_lock and uses internal lock (buffer lock on
      	superblock buffer) to serialize ->write_super.  Also xfs_fs_write_super
      	is superflous and will go away in the next merge window
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ebc1ac16
    • C
      push BKL down into ->put_super · 6cfd0148
      Christoph Hellwig 提交于
      Move BKL into ->put_super from the only caller.  A couple of
      filesystems had trivial enough ->put_super (only kfree and NULLing of
      s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
      hugetlbfs, omfs, qnx4, shmem, all others got the full treatment.  Most
      of them probably don't need it, but I'd rather sort that out individually.
      Preferably after all the other BKL pushdowns in that area.
      
      [AV: original used to move lock_super() down as well; these changes are
      removed since we don't do lock_super() at all in generic_shutdown_super()
      now]
      [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6cfd0148
    • C
      remove ->write_super call in generic_shutdown_super · 8c85e125
      Christoph Hellwig 提交于
      We just did a full fs writeout using sync_filesystem before, and if
      that's not enough for the filesystem it can perform it's own writeout
      in ->put_super, which many filesystems already do.
      
      Move a call to foofs_write_super into every foofs_put_super for now to
      guarantee identical behaviour until it's cleaned up by the individual
      filesystem maintainers.
      
      Exceptions:
      
       - affs already has identical copy & pasted code at the beginning of
         affs_put_super so no need to do it twice.
       - xfs does the right thing without it and I have changes pending for
         the xfs tree touching this are so I don't really need conflicts
         here..
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      8c85e125
  6. 04 6月, 2009 1 次提交
  7. 03 4月, 2009 1 次提交
  8. 01 4月, 2009 1 次提交
  9. 12 3月, 2009 1 次提交
  10. 14 11月, 2008 1 次提交
  11. 12 11月, 2008 1 次提交
  12. 07 11月, 2008 9 次提交
  13. 31 10月, 2008 1 次提交
  14. 23 10月, 2008 1 次提交
  15. 14 10月, 2008 1 次提交
  16. 20 8月, 2008 1 次提交
    • L
      vfat: fix 'sync' mount deadlock due to BKL->lock_super conversion · 5f22ca9b
      Linus Torvalds 提交于
      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-ga7f5aaf3 #16
        ---------------------------------------------
        mv/4020 is trying to acquire lock:
         (&type->s_lock_key#9){--..}, at: [<c01a90fe>] lock_super+0x1e/0x20
      
        but task is already holding lock:
         (&type->s_lock_key#9){--..}, at: [<c01a90fe>] 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: [<c01b2336>] do_unlinkat+0x66/0x140
         #1:  (&sb->s_type->i_mutex_key#9){--..}, at: [<c01b0954>] vfs_unlink+0x84/0x110
         #2:  (&type->s_lock_key#9){--..}, at: [<c01a90fe>] lock_super+0x1e/0x20
      
        stack backtrace:
        Pid: 4020, comm: mv Not tainted 2.6.27-rc3-bisect-00448-ga7f5aaf3 #16
         [<c014e694>] validate_chain+0x984/0xea0
         [<c0108d70>] ? native_sched_clock+0x0/0xf0
         [<c014ee9c>] __lock_acquire+0x2ec/0x9b0
         [<c014f5cf>] lock_acquire+0x6f/0x90
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c044e5fd>] mutex_lock_nested+0xad/0x300
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c01a90fe>] ? lock_super+0x1e/0x20
         [<c01a90fe>] lock_super+0x1e/0x20
         [<f8b3a700>] fat_write_inode+0x60/0x2b0 [fat]
         [<c0450878>] ? _spin_unlock_irqrestore+0x48/0x80
         [<f8b3a953>] ? fat_sync_inode+0x3/0x20 [fat]
         [<f8b3a962>] fat_sync_inode+0x12/0x20 [fat]
         [<f8b37c7e>] fat_remove_entries+0xbe/0x120 [fat]
         [<f8b422ef>] vfat_unlink+0x5f/0x90 [vfat]
         [<f8b42290>] ? vfat_unlink+0x0/0x90 [vfat]
         [<c01b0968>] vfs_unlink+0x98/0x110
         [<c01b2400>] do_unlinkat+0x130/0x140
         [<c016a8f5>] ? audit_syscall_entry+0x105/0x150
         [<c01b253b>] sys_unlinkat+0x3b/0x40
         [<c01040d3>] 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 <bart@jukie.net>"
      Reported-and-tested-by: NBart Trojanowski <bart@jukie.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f22ca9b
  17. 27 7月, 2008 1 次提交
  18. 26 7月, 2008 2 次提交
    • J
      fatfs: add UTC timestamp option · b271e067
      Joe Peterson 提交于
      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: NJoe Peterson <joe@skyrush.com>
      Signed-off-by: NPaul Collins <paul@ondioline.org>
      Acked-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Barry Bouwsma <free_beer_for_all@yahoo.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b271e067
    • O
      fat: fix parse_options() · 8d44d974
      OGAWA Hirofumi 提交于
      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: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d44d974
  19. 21 6月, 2008 1 次提交
    • L
      Replace BKL with superblock lock in fat/msdos/vfat · 8f593427
      Linus Torvalds 提交于
      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: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      8f593427
  20. 29 4月, 2008 1 次提交
  21. 28 4月, 2008 5 次提交
  22. 09 2月, 2008 1 次提交
  23. 08 2月, 2008 1 次提交