1. 22 6月, 2012 5 次提交
  2. 21 6月, 2012 2 次提交
    • J
      xfs: fix debug_object WARN at xfs_alloc_vextent() · 3b876c8f
      Jeff Liu 提交于
      Fengguang reports:
      
      [  780.529603] XFS (vdd): Ending clean mount
      [  781.454590] ODEBUG: object is on stack, but not annotated
      [  781.455433] ------------[ cut here ]------------
      [  781.455433] WARNING: at /c/kernel-tests/sound/lib/debugobjects.c:301 __debug_object_init+0x173/0x1f1()
      [  781.455433] Hardware name: Bochs
      [  781.455433] Modules linked in:
      [  781.455433] Pid: 26910, comm: kworker/0:2 Not tainted 3.4.0+ #51
      [  781.455433] Call Trace:
      [  781.455433]  [<ffffffff8106bc84>] warn_slowpath_common+0x83/0x9b
      [  781.455433]  [<ffffffff8106bcb6>] warn_slowpath_null+0x1a/0x1c
      [  781.455433]  [<ffffffff814919a5>] __debug_object_init+0x173/0x1f1
      [  781.455433]  [<ffffffff81491c65>] debug_object_init+0x14/0x16
      [  781.455433]  [<ffffffff8108842a>] __init_work+0x20/0x22
      [  781.455433]  [<ffffffff8134ea56>] xfs_alloc_vextent+0x6c/0xd5
      
      Use INIT_WORK_ONSTACK in xfs_alloc_vextent instead of INIT_WORK.
      Reported-by: NWu Fengguang <wfg@linux.intel.com>
      Signed-off-by: NJie Liu <jeff.liu@oracle.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      3b876c8f
    • A
      xfs: xfs_vm_writepage clear iomap_valid when !buffer_uptodate (REV2) · 66f93113
      Alain Renaud 提交于
      On filesytems with a block size smaller than PAGE_SIZE we currently have
      a problem with unwritten extents.  If a we have multi-block page for
      which an unwritten extent has been allocated, and only some of the
      buffers have been written to, and they are not contiguous, we can expose
      stale data from disk in the blocks between the writes after extent
      conversion.
      
      Example of a page with unwritten and real data.
      buffer  content
      0       empty  b_state = 0
      1       DATA   b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
      2       DATA   b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
      3       empty  b_state = 0
      4       empty  b_state = 0
      5       DATA   b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
      6       DATA   b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
      7       empty  b_state = 0
      
      Buffers 1, 2, 5, and 6 have been written to, leaving 0, 3, 4, and 7
      empty.  Currently buffers 1, 2, 5, and 6 are added to a single ioend,
      and when IO has completed, extent conversion creates a real extent from
      block 1 through block 6, leaving 0 and 7 unwritten.  However buffers 3
      and 4 were not written to disk, so stale data is exposed from those
      blocks on a subsequent read.
      
      Fix this by setting iomap_valid = 0 when we find a buffer that is not
      Uptodate.  This ensures that buffers 5 and 6 are not added to the same
      ioend as buffers 1 and 2.  Later these blocks will be converted into two
      separate real extents, leaving the blocks in between unwritten.
      Signed-off-by: NAlain Renaud <arenaud@sgi.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      66f93113
  3. 02 6月, 2012 1 次提交
    • J
      fs: introduce inode operation ->update_time · c3b2da31
      Josef Bacik 提交于
      Btrfs has to make sure we have space to allocate new blocks in order to modify
      the inode, so updating time can fail.  We've gotten around this by having our
      own file_update_time but this is kind of a pain, and Christoph has indicated he
      would like to make xfs do something different with atime updates.  So introduce
      ->update_time, where we will deal with i_version an a/m/c time updates and
      indicate which changes need to be made.  The normal version just does what it
      has always done, updates the time and marks the inode dirty, and then
      filesystems can choose to do something different.
      
      I've gone through all of the users of file_update_time and made them check for
      errors with the exception of the fault code since it's complicated and I wasn't
      quite sure what to do there, also Jan is going to be pushing the file time
      updates into page_mkwrite for those who have it so that should satisfy btrfs and
      make it not a big deal to check the file_update_time() return code in the
      generic fault path. Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      c3b2da31
  4. 30 5月, 2012 2 次提交
  5. 21 5月, 2012 3 次提交
    • D
      xfs: add trace points for log forces · 14c26c6a
      Dave Chinner 提交于
      To enable easy tracing of the location of log forces and the
      frequency of them via perf, add a pair of trace points to the log
      force functions.  This will help debug where excessive log forces
      are being issued from by simple perf commands like:
      
      # ~/perf/perf top -e xfs:xfs_log_force -G -U
      
      Which gives this sort of output:
      
      Events: 141  xfs:xfs_log_force
      -  100.00%  [kernel]  [k] xfs_log_force
         - xfs_log_force
              87.04% xfsaild
                 kthread
                 kernel_thread_helper
            - 12.87% xfs_buf_lock
                 _xfs_buf_find
                 xfs_buf_get
                 xfs_trans_get_buf
                 xfs_da_do_buf
                 xfs_da_get_buf
                 xfs_dir2_data_init
                 xfs_dir2_leaf_addname
                 xfs_dir_createname
                 xfs_create
                 xfs_vn_mknod
                 xfs_vn_create
                 vfs_create
                 do_last.isra.41
                 path_openat
                 do_filp_open
                 do_sys_open
                 sys_open
                 system_call_fastpath
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sig.com>
      14c26c6a
    • P
      xfs: fix memory reclaim deadlock on agi buffer · 3ba31603
      Peter Watkins 提交于
      Note xfs_iget can be called while holding a locked agi buffer. If
      it goes into memory reclaim then inode teardown may try to lock the
      same buffer. Prevent the deadlock by calling radix_tree_preload
      with GFP_NOFS.
      Signed-off-by: NPeter Watkins <treestem@gmail.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      3ba31603
    • D
      xfs: fix delalloc quota accounting on failure · ea562ed6
      Dave Chinner 提交于
      xfstest 270 was causing quota reservations way beyond what was sane
      (ten to hundreds of TB) for a 4GB filesystem. There's a sign problem
      in the error handling path of xfs_bmapi_reserve_delalloc() because
      xfs_trans_unreserve_quota_nblks() simple negates the value passed -
      which doesn't work for an unsigned variable. This causes
      reservations of close to 2^32 block instead of removing a
      reservation of a handful of blocks.
      
      Fix the same problem in the other xfs_trans_unreserve_quota_nblks()
      callers where unsigned integer variables are used, too.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      ea562ed6
  6. 16 5月, 2012 1 次提交
    • B
      xfs: protect xfs_sync_worker with s_umount semaphore · 1307bbd2
      Ben Myers 提交于
      xfs_sync_worker checks the MS_ACTIVE flag in s_flags to avoid doing
      work during mount and unmount.  This flag can be cleared by unmount
      after the xfs_sync_worker checks it but before the work is completed.
      The has caused crashes in the completion handler for the dummy
      transaction commited by xfs_sync_worker:
      
      PID: 27544  TASK: ffff88013544e040  CPU: 3   COMMAND: "kworker/3:0"
       #0 [ffff88016fdff930] machine_kexec at ffffffff810244e9
       #1 [ffff88016fdff9a0] crash_kexec at ffffffff8108d053
       #2 [ffff88016fdffa70] oops_end at ffffffff813ad1b8
       #3 [ffff88016fdffaa0] no_context at ffffffff8102bd48
       #4 [ffff88016fdffaf0] __bad_area_nosemaphore at ffffffff8102c04d
       #5 [ffff88016fdffb40] bad_area_nosemaphore at ffffffff8102c12e
       #6 [ffff88016fdffb50] do_page_fault at ffffffff813afaee
       #7 [ffff88016fdffc60] page_fault at ffffffff813ac635
          [exception RIP: xlog_get_lowest_lsn+0x30]
          RIP: ffffffffa04a9910  RSP: ffff88016fdffd10  RFLAGS: 00010246
          RAX: ffffc90014e48000  RBX: ffff88014d879980  RCX: ffff88014d879980
          RDX: ffff8802214ee4c0  RSI: 0000000000000000  RDI: 0000000000000000
          RBP: ffff88016fdffd10   R8: ffff88014d879a80   R9: 0000000000000000
          R10: 0000000000000001  R11: 0000000000000000  R12: ffff8802214ee400
          R13: ffff88014d879980  R14: 0000000000000000  R15: ffff88022fd96605
          ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
       #8 [ffff88016fdffd18] xlog_state_do_callback at ffffffffa04aa186 [xfs]
       #9 [ffff88016fdffd98] xlog_state_done_syncing at ffffffffa04aa568 [xfs]
      
      Protect xfs_sync_worker by using the s_umount semaphore at the read
      level to provide exclusion with unmount while work is progressing.
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      1307bbd2
  7. 15 5月, 2012 26 次提交