1. 11 9月, 2011 2 次提交
    • S
      btrfs: fix warning in iput for bad-inode · e0b6d65b
      Sergei Trofimovich 提交于
      iput() shouldn't be called for inodes in I_NEW state.
      We need to mark inode as constructed first.
      
      WARNING: at fs/inode.c:1309 iput+0x20b/0x210()
      Call Trace:
       [<ffffffff8103e7ba>] warn_slowpath_common+0x7a/0xb0
       [<ffffffff8103e805>] warn_slowpath_null+0x15/0x20
       [<ffffffff810eaf0b>] iput+0x20b/0x210
       [<ffffffff811b96fb>] btrfs_iget+0x1eb/0x4a0
       [<ffffffff811c3ad6>] btrfs_run_defrag_inodes+0x136/0x210
       [<ffffffff811ad55f>] cleaner_kthread+0x17f/0x1a0
       [<ffffffff81035b7d>] ? sub_preempt_count+0x9d/0xd0
       [<ffffffff811ad3e0>] ? transaction_kthread+0x280/0x280
       [<ffffffff8105af86>] kthread+0x96/0xa0
       [<ffffffff814336d4>] kernel_thread_helper+0x4/0x10
       [<ffffffff8105aef0>] ? kthread_worker_fn+0x190/0x190
       [<ffffffff814336d0>] ? gs_change+0xb/0xb
      Signed-off-by: NSergei Trofimovich <slyfox@gentoo.org>
      CC: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Tested-by: NDavid Sterba <dsterba@suse.cz>
      CC: Josef Bacik <josef@redhat.com>
      CC: Chris Mason <chris.mason@oracle.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      e0b6d65b
    • L
      Btrfs: fix an oops when deleting snapshots · 14c7cca7
      Liu Bo 提交于
      We can reproduce this oops via the following steps:
      
      $ mkfs.btrfs /dev/sdb7
      $ mount /dev/sdb7 /mnt/btrfs
      $ for ((i=0; i<3; i++)); do btrfs sub snap /mnt/btrfs /mnt/btrfs/s_$i; done
      $ rm -fr /mnt/btrfs/*
      $ rm -fr /mnt/btrfs/*
      
      then we'll get
      ------------[ cut here ]------------
      kernel BUG at fs/btrfs/inode.c:2264!
      [...]
      Call Trace:
       [<ffffffffa05578c7>] btrfs_rmdir+0xf7/0x1b0 [btrfs]
       [<ffffffff81150b95>] vfs_rmdir+0xa5/0xf0
       [<ffffffff81153cc3>] do_rmdir+0x123/0x140
       [<ffffffff81145ac7>] ? fput+0x197/0x260
       [<ffffffff810aecff>] ? audit_syscall_entry+0x1bf/0x1f0
       [<ffffffff81153d0d>] sys_unlinkat+0x2d/0x40
       [<ffffffff8147896b>] system_call_fastpath+0x16/0x1b
      RIP  [<ffffffffa054f7b9>] btrfs_orphan_add+0x179/0x1a0 [btrfs]
      
      When it comes to btrfs_lookup_dentry, we may set a snapshot's inode->i_ino
      to BTRFS_EMPTY_SUBVOL_DIR_OBJECTID instead of BTRFS_FIRST_FREE_OBJECTID,
      while the snapshot's location.objectid remains unchanged.
      
      However, btrfs_ino() does not take this into account, and returns a wrong ino,
      and causes the oops.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      14c7cca7
  2. 18 8月, 2011 1 次提交
  3. 17 8月, 2011 10 次提交
  4. 06 8月, 2011 1 次提交
  5. 02 8月, 2011 25 次提交
  6. 28 7月, 2011 1 次提交