1. 07 5月, 2014 9 次提交
    • J
      f2fs: avoid to conduct roll-forward due to the remained garbage blocks · 1e87a78d
      Jaegeuk Kim 提交于
      The f2fs always scans the next chain of direct node blocks.
      But some garbage blocks are able to be remained due to no discard support or
      SSR triggers.
      This occasionally wreaks recovering wrong inodes that were used or BUG_ONs
      due to reallocating node ids as follows.
      
      When mount this f2fs image:
      http://linuxtesting.org/downloads/f2fs_fault_image.zip
      BUG_ON is triggered in f2fs driver (messages below are generated on
      kernel 3.13.2; for other kernels output is similar):
      
      kernel BUG at fs/f2fs/node.c:215!
       Call Trace:
       [<ffffffffa032ebad>] recover_inode_page+0x1fd/0x3e0 [f2fs]
       [<ffffffff811446e7>] ? __lock_page+0x67/0x70
       [<ffffffff81089990>] ? autoremove_wake_function+0x50/0x50
       [<ffffffffa0337788>] recover_fsync_data+0x1398/0x15d0 [f2fs]
       [<ffffffff812b9e5c>] ? selinux_d_instantiate+0x1c/0x20
       [<ffffffff811cb20b>] ? d_instantiate+0x5b/0x80
       [<ffffffffa0321044>] f2fs_fill_super+0xb04/0xbf0 [f2fs]
       [<ffffffff811b861e>] ? mount_bdev+0x7e/0x210
       [<ffffffff811b8769>] mount_bdev+0x1c9/0x210
       [<ffffffffa0320540>] ? validate_superblock+0x210/0x210 [f2fs]
       [<ffffffffa031cf8d>] f2fs_mount+0x1d/0x30 [f2fs]
       [<ffffffff811b9497>] mount_fs+0x47/0x1c0
       [<ffffffff81166e00>] ? __alloc_percpu+0x10/0x20
       [<ffffffff811d4032>] vfs_kern_mount+0x72/0x110
       [<ffffffff811d6763>] do_mount+0x493/0x910
       [<ffffffff811615cb>] ? strndup_user+0x5b/0x80
       [<ffffffff811d6c70>] SyS_mount+0x90/0xe0
       [<ffffffff8166f8d9>] system_call_fastpath+0x16/0x1b
      
      Found by Linux File System Verification project (linuxtesting.org).
      Reported-by: NAndrey Tsyvarev <tsyvarev@ispras.ru>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      1e87a78d
    • G
      f2fs: enable flush_merge only in f2fs is not read-only · b270ad6f
      Gu Zheng 提交于
      Enable flush_merge only in f2fs is not read-only, so does the mount
      option show.
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      b270ad6f
    • G
      197d4647
    • G
      f2fs: put the bio when issue_flush completed · a4ed23f2
      Gu Zheng 提交于
      Put the bio when the flush cmd issued, it also can fix the following
      kmemleak:
      unreferenced object 0xffff8800270c73c0 (size 200):
        comm "f2fs_flush-7:0", pid 27161, jiffies 4312127988 (age 988.503s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 40 07 81 19 01 88 ff ff  ........@.......
          01 00 00 00 00 00 00 f0 11 14 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff81559866>] kmemleak_alloc+0x72/0x96
          [<ffffffff81156f7e>] slab_post_alloc_hook+0x28/0x2a
          [<ffffffff811595b1>] kmem_cache_alloc+0xec/0x157
          [<ffffffff8111924d>] mempool_alloc_slab+0x15/0x17
          [<ffffffff81119513>] mempool_alloc+0x71/0x138
          [<ffffffff81193548>] bio_alloc_bioset+0x93/0x18c
          [<ffffffffa040f857>] issue_flush_thread+0x8d/0x145 [f2fs]
          [<ffffffff8107ac16>] kthread+0xba/0xc2
          [<ffffffff81571b2c>] ret_from_fork+0x7c/0xb0
          [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      a4ed23f2
    • F
      fs/affs/super.c: bugfix / double free · d353efd0
      Fabian Frederick 提交于
      Commit 842a859d ("affs: use ->kill_sb() to simplify ->put_super()
      and failure exits of ->mount()") adds .kill_sb which frees sbi but
      doesn't remove sbi free in case of parse_options error causing double
      free+random crash.
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>	[3.14.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d353efd0
    • W
      fanotify: fix -EOVERFLOW with large files on 64-bit · 1e2ee49f
      Will Woods 提交于
      On 64-bit systems, O_LARGEFILE is automatically added to flags inside
      the open() syscall (also openat(), blkdev_open(), etc).  Userspace
      therefore defines O_LARGEFILE to be 0 - you can use it, but it's a
      no-op.  Everything should be O_LARGEFILE by default.
      
      But: when fanotify does create_fd() it uses dentry_open(), which skips
      all that.  And userspace can't set O_LARGEFILE in fanotify_init()
      because it's defined to 0.  So if fanotify gets an event regarding a
      large file, the read() will just fail with -EOVERFLOW.
      
      This patch adds O_LARGEFILE to fanotify_init()'s event_f_flags on 64-bit
      systems, using the same test as open()/openat()/etc.
      
      Addresses https://bugzilla.redhat.com/show_bug.cgi?id=696821Signed-off-by: NWill Woods <wwoods@redhat.com>
      Acked-by: NEric Paris <eparis@redhat.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e2ee49f
    • I
      autofs: fix lockref lookup · 6b6751f7
      Ian Kent 提交于
      autofs needs to be able to see private data dentry flags for its dentrys
      that are being created but not yet hashed and for its dentrys that have
      been rmdir()ed but not yet freed.  It needs to do this so it can block
      processes in these states until a status has been returned to indicate
      the given operation is complete.
      
      It does this by keeping two lists, active and expring, of dentrys in
      this state and uses ->d_release() to keep them stable while it checks
      the reference count to determine if they should be used.
      
      But with the recent lockref changes dentrys being freed sometimes don't
      transition to a reference count of 0 before being freed so autofs can
      occassionally use a dentry that is invalid which can lead to a panic.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6b6751f7
    • N
      hugetlb: ensure hugepage access is denied if hugepages are not supported · 457c1b27
      Nishanth Aravamudan 提交于
      Currently, I am seeing the following when I `mount -t hugetlbfs /none
      /dev/hugetlbfs`, and then simply do a `ls /dev/hugetlbfs`.  I think it's
      related to the fact that hugetlbfs is properly not correctly setting
      itself up in this state?:
      
        Unable to handle kernel paging request for data at address 0x00000031
        Faulting instruction address: 0xc000000000245710
        Oops: Kernel access of bad area, sig: 11 [#1]
        SMP NR_CPUS=2048 NUMA pSeries
        ....
      
      In KVM guests on Power, in a guest not backed by hugepages, we see the
      following:
      
        AnonHugePages:         0 kB
        HugePages_Total:       0
        HugePages_Free:        0
        HugePages_Rsvd:        0
        HugePages_Surp:        0
        Hugepagesize:         64 kB
      
      HPAGE_SHIFT == 0 in this configuration, which indicates that hugepages
      are not supported at boot-time, but this is only checked in
      hugetlb_init().  Extract the check to a helper function, and use it in a
      few relevant places.
      
      This does make hugetlbfs not supported (not registered at all) in this
      environment.  I believe this is fine, as there are no valid hugepages
      and that won't change at runtime.
      
      [akpm@linux-foundation.org: use pr_info(), per Mel]
      [akpm@linux-foundation.org: fix build when HPAGE_SHIFT is undefined]
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      457c1b27
    • C
      posix_acl: handle NULL ACL in posix_acl_equiv_mode · 50c6e282
      Christoph Hellwig 提交于
      Various filesystems don't bother checking for a NULL ACL in
      posix_acl_equiv_mode, and thus can dereference a NULL pointer when it
      gets passed one. This usually happens from the NFS server, as the ACL tools
      never pass a NULL ACL, but instead of one representing the mode bits.
      
      Instead of adding boilerplat to all filesystems put this check into one place,
      which will allow us to remove the check from other filesystems as well later
      on.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reported-by: NBen Greear <greearb@candelatech.com>
      Reported-by: Marco Munderloh <munderl@tnt.uni-hannover.de>,
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      50c6e282
  2. 05 5月, 2014 1 次提交
  3. 04 5月, 2014 3 次提交
    • M
      dcache: don't need rcu in shrink_dentry_list() · 60942f2f
      Miklos Szeredi 提交于
      Since now the shrink list is private and nobody can free the dentry while
      it is on the shrink list, we can remove RCU protection from this.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      60942f2f
    • A
      more graceful recovery in umount_collect() · 9c8c10e2
      Al Viro 提交于
      Start with shrink_dcache_parent(), then scan what remains.
      
      First of all, BUG() is very much an overkill here; we are holding
      ->s_umount, and hitting BUG() means that a lot of interesting stuff
      will be hanging after that point (sync(2), for example).  Moreover,
      in cases when there had been more than one leak, we'll be better
      off reporting all of them.  And more than just the last component
      of pathname - %pd is there for just such uses...
      
      That was the last user of dentry_lru_del(), so kill it off...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9c8c10e2
    • A
      don't remove from shrink list in select_collect() · fe91522a
      Al Viro 提交于
      	If we find something already on a shrink list, just increment
      data->found and do nothing else.  Loops in shrink_dcache_parent() and
      check_submounts_and_drop() will do the right thing - everything we
      did put into our list will be evicted and if there had been nothing,
      but data->found got non-zero, well, we have somebody else shrinking
      those guys; just try again.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      fe91522a
  4. 01 5月, 2014 6 次提交
  5. 29 4月, 2014 5 次提交
  6. 28 4月, 2014 16 次提交