1. 06 11月, 2019 1 次提交
  2. 25 9月, 2019 2 次提交
  3. 13 7月, 2019 1 次提交
  4. 31 5月, 2019 1 次提交
  5. 06 3月, 2019 1 次提交
  6. 27 10月, 2018 1 次提交
  7. 18 8月, 2018 2 次提交
  8. 06 4月, 2018 1 次提交
  9. 01 2月, 2018 3 次提交
  10. 16 11月, 2017 1 次提交
  11. 03 11月, 2017 1 次提交
  12. 07 9月, 2017 1 次提交
  13. 02 3月, 2017 1 次提交
  14. 11 12月, 2016 2 次提交
  15. 28 9月, 2016 1 次提交
  16. 20 9月, 2016 2 次提交
    • J
      ocfs2: fix trans extend while free cached blocks · d5bf1418
      Junxiao Bi 提交于
      The root cause of this issue is the same with the one fixed by the last
      patch, but this time credits for allocator inode and group descriptor
      may not be consumed before trans extend.
      
      The following error was caught:
      
        WARNING: CPU: 0 PID: 2037 at fs/jbd2/transaction.c:269 start_this_handle+0x4c3/0x510 [jbd2]()
        Modules linked in: ocfs2 nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sd_mod sg ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ppdev xen_kbdfront fb_sys_fops sysimgblt sysfillrect syscopyarea xen_netfront parport_pc parport pcspkr i2c_piix4 i2c_core acpi_cpufreq ext4 jbd2 mbcache xen_blkfront floppy pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod
        CPU: 0 PID: 2037 Comm: rm Tainted: G        W       4.1.12-37.6.3.el6uek.bug24573128v2.x86_64 #2
        Hardware name: Xen HVM domU, BIOS 4.4.4OVM 02/11/2016
        Call Trace:
          dump_stack+0x48/0x5c
          warn_slowpath_common+0x95/0xe0
          warn_slowpath_null+0x1a/0x20
          start_this_handle+0x4c3/0x510 [jbd2]
          jbd2__journal_restart+0x161/0x1b0 [jbd2]
          jbd2_journal_restart+0x13/0x20 [jbd2]
          ocfs2_extend_trans+0x74/0x220 [ocfs2]
          ocfs2_free_cached_blocks+0x16b/0x4e0 [ocfs2]
          ocfs2_run_deallocs+0x70/0x270 [ocfs2]
          ocfs2_commit_truncate+0x474/0x6f0 [ocfs2]
          ocfs2_truncate_for_delete+0xbd/0x380 [ocfs2]
          ocfs2_wipe_inode+0x136/0x6a0 [ocfs2]
          ocfs2_delete_inode+0x2a2/0x3e0 [ocfs2]
          ocfs2_evict_inode+0x28/0x60 [ocfs2]
          evict+0xab/0x1a0
          iput_final+0xf6/0x190
          iput+0xc8/0xe0
          do_unlinkat+0x1b7/0x310
          SyS_unlinkat+0x22/0x40
          system_call_fastpath+0x12/0x71
        ---[ end trace a62437cb060baa71 ]---
        JBD2: rm wants too many credits (149 > 128)
      
      Link: http://lkml.kernel.org/r/1473674623-11810-2-git-send-email-junxiao.bi@oracle.comSigned-off-by: NJunxiao Bi <junxiao.bi@oracle.com>
      Reviewed-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d5bf1418
    • J
      ocfs2: fix trans extend while flush truncate log · 2b0ad008
      Junxiao Bi 提交于
      Every time, ocfs2_extend_trans() included a credit for truncate log
      inode, but as that inode had been managed by jbd2 running transaction
      first time, it will not consume that credit until
      jbd2_journal_restart().
      
      Since total credits to extend always included the un-consumed ones,
      there will be more and more un-consumed credit, at last
      jbd2_journal_restart() will fail due to credit number over the half of
      max transction credit.
      
      The following error was caught when unlinking a large file with many
      extents:
      
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 13626 at fs/jbd2/transaction.c:269 start_this_handle+0x4c3/0x510 [jbd2]()
        Modules linked in: ocfs2 nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sd_mod sg ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ppdev xen_kbdfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea parport_pc parport pcspkr i2c_piix4 i2c_core acpi_cpufreq ext4 jbd2 mbcache xen_blkfront floppy pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod
        CPU: 0 PID: 13626 Comm: unlink Tainted: G        W       4.1.12-37.6.3.el6uek.x86_64 #2
        Hardware name: Xen HVM domU, BIOS 4.4.4OVM 02/11/2016
        Call Trace:
          dump_stack+0x48/0x5c
          warn_slowpath_common+0x95/0xe0
          warn_slowpath_null+0x1a/0x20
          start_this_handle+0x4c3/0x510 [jbd2]
          jbd2__journal_restart+0x161/0x1b0 [jbd2]
          jbd2_journal_restart+0x13/0x20 [jbd2]
          ocfs2_extend_trans+0x74/0x220 [ocfs2]
          ocfs2_replay_truncate_records+0x93/0x360 [ocfs2]
          __ocfs2_flush_truncate_log+0x13e/0x3a0 [ocfs2]
          ocfs2_remove_btree_range+0x458/0x7f0 [ocfs2]
          ocfs2_commit_truncate+0x1b3/0x6f0 [ocfs2]
          ocfs2_truncate_for_delete+0xbd/0x380 [ocfs2]
          ocfs2_wipe_inode+0x136/0x6a0 [ocfs2]
          ocfs2_delete_inode+0x2a2/0x3e0 [ocfs2]
          ocfs2_evict_inode+0x28/0x60 [ocfs2]
          evict+0xab/0x1a0
          iput_final+0xf6/0x190
          iput+0xc8/0xe0
          do_unlinkat+0x1b7/0x310
          SyS_unlink+0x16/0x20
          system_call_fastpath+0x12/0x71
        ---[ end trace 28aa7410e69369cf ]---
        JBD2: unlink wants too many credits (251 > 128)
      
      Link: http://lkml.kernel.org/r/1473674623-11810-1-git-send-email-junxiao.bi@oracle.comSigned-off-by: NJunxiao Bi <junxiao.bi@oracle.com>
      Reviewed-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2b0ad008
  17. 03 8月, 2016 1 次提交
  18. 20 5月, 2016 1 次提交
  19. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  20. 26 3月, 2016 3 次提交
    • X
      ocfs2: extend enough credits for freeing one truncate record while replaying truncate records · 102c2595
      Xue jiufei 提交于
      Now function ocfs2_replay_truncate_records() first modifies tl_used,
      then calls ocfs2_extend_trans() to extend transactions for gd and alloc
      inode used for freeing clusters.  jbd2_journal_restart() may be called
      and it may happen that tl_used in truncate log is decreased but the
      clusters are not freed, which means these clusters are lost.  So we
      should avoid extending transactions in these two operations.
      Signed-off-by: Njoyce.xue <xuejiufei@huawei.com>
      Reviewed-by: NMark Fasheh <mfasheh@suse.de>
      Acked-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      102c2595
    • X
      ocfs2: extend transaction for ocfs2_remove_rightmost_path() and... · 17215989
      Xue jiufei 提交于
      ocfs2: extend transaction for ocfs2_remove_rightmost_path() and ocfs2_update_edge_lengths() before to avoid inconsistency between inode and et
      
      I found that jbd2_journal_restart() is called in some places without
      keeping things consistently before.  However, jbd2_journal_restart() may
      commit the handle's transaction and restart another one.  If the first
      transaction is committed successfully while another not, it may cause
      filesystem inconsistency or read only.  This is an effort to fix this
      kind of problems.
      
      This patch (of 3):
      
      The following functions will be called while truncating an extent:
      ocfs2_remove_btree_range
        -> ocfs2_start_trans
        -> ocfs2_remove_extent
           -> ocfs2_truncate_rec
             -> ocfs2_extend_rotate_transaction
               -> jbd2_journal_restart if jbd2_journal_extend fail
             -> ocfs2_rotate_tree_left
               -> ocfs2_remove_rightmost_path
                   -> ocfs2_extend_rotate_transaction
                     -> ocfs2_unlink_subtree
                      -> ocfs2_update_edge_lengths
                        -> ocfs2_extend_trans
                          -> jbd2_journal_restart if jbd2_journal_extend fail
        -> ocfs2_et_update_clusters
        -> ocfs2_commit_trans
      
      jbd2_journal_restart() may be called and it may happened that the buffers
      dirtied in ocfs2_truncate_rec() are committed while buffers dirtied in
      ocfs2_et_update_clusters() are not, the total clusters on extent tree and
      i_clusters in ocfs2_dinode is inconsistency.  So the clusters got from
      ocfs2_dinode is incorrect, and it also cause read-only problem when call
      ocfs2_commit_truncate() with the error message: "Inode %llu has empty
      extent block at %llu".
      
      We should extend enough credits for function ocfs2_remove_rightmost_path
      and ocfs2_update_edge_lengths to avoid this inconsistency.
      Signed-off-by: Njoyce.xue <xuejiufei@huawei.com>
      Acked-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      17215989
    • J
      ocfs2: fix occurring deadlock by changing ocfs2_wq from global to local · 35ddf78e
      jiangyiwen 提交于
      This patch fixes a deadlock, as follows:
      
        Node 1                Node 2                  Node 3
      1)volume a and b are    only mount vol a        only mount vol b
        mounted
      
      2)                      start to mount b        start to mount a
      
      3)                      check hb of Node 3      check hb of Node 2
                              in vol a, qs_holds++    in vol b, qs_holds++
      
      4) -------------------- all nodes' network down --------------------
      
      5)                      progress of mount b     the same situation as
                              failed, and then call   Node 2
                              ocfs2_dismount_volume.
                              but the process is hung,
                              since there is a work
                              in ocfs2_wq cannot beo
                              completed. This work is
                              about vol a, because
                              ocfs2_wq is global wq.
                              BTW, this work which is
                              scheduled in ocfs2_wq is
                              ocfs2_orphan_scan_work,
                              and the context in this work
                              needs to take inode lock
                              of orphan_dir, because
                              lockres owner are Node 1 and
                              all nodes' nework has been down
                              at the same time, so it can't
                              get the inode lock.
      
      6)                      Why can't this node be fenced
                              when network disconnected?
                              Because the process of
                              mount is hung what caused qs_holds
                              is not equal 0.
      
      Because all works in the ocfs2_wq are relative to the super block.
      
      The solution is to change the ocfs2_wq from global to local.  In other
      words, move it into struct ocfs2_super.
      Signed-off-by: NYiwen Jiang <jiangyiwen@huawei.com>
      Reviewed-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Xue jiufei <xuejiufei@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      35ddf78e
  21. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  22. 15 1月, 2016 2 次提交
  23. 05 9月, 2015 4 次提交
  24. 25 6月, 2015 2 次提交
    • X
      ocfs2: remove BUG_ON(!empty_extent) in __ocfs2_rotate_tree_left() · 099768b0
      Xue jiufei 提交于
      ocfs2_rotate_tree_left() calls __ocfs2_rotate_tree_left() for left
      rotation while non-rightmost path containing an empty extent in the leaf
      block.  __ocfs2_rotate_tree_left() returns -EAGAIN if right subtree having an
      empty extent and pass the empty_extent_path to caller.  The caller
      ocfs2_rotate_tree_left() will restart rotation from the returned path.
      
      It will trigger the BUG_ON(!ocfs2_is_empty_extent) when the et on disk
      is as follows:
      
      eb0 is the leaf block of path(say path_a) passed to
      ocfs2_rotate_tree_left, which has an empty rec[0].
      
      eb1 is the leaf block of path(say path_b) that just right to path_a, which
      has no empty record.
      
      eb2 is the leaf block of path(say path_c) that just right to path_b, which
      has an empty rec[0].  And path_c is also the rightmost path.
      
      Now we want to remove the empty rec[0] in eb0:
      
      ocfs2_rotate_tree_left:
        -> call __ocfs2_rotate_tree_left with path_a as its input *path*
          -> call ocfs2_rotate_subtree_left with path_a as its input
             *left_path* and path_b as its input *right_path*. it will move
             rec[0] in eb1 to eb0, and rec[0] in eb0 is not empty now.
          -> continue to call ocfs2_rotate_subtree_left with path_b as its
             input *left_path* and path_c as its input *right_path*, and
             return -EAGAIN because eb2 has an empty rec[0]
        -> call __ocfs2_rotate_tree_left with path_c as it input, rotate all
           records in eb2 to left and return 0.
        -> call __ocfs2_rotate_tree_left with path_a as its input, and triggers
           the BUG_ON(!ocfs2_is_empty_extent) as the rec[0] in eb0 is not empty.
      
      So the BUG_ON() should be removed and return 0 if rec[0] is no longer an
      empty extent.
      Signed-off-by: Njoyce.xue <xuejiufei@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      099768b0
    • X
      ocfs2: return error when ocfs2_figure_merge_contig_type() fails · 9f99ad08
      Xue jiufei 提交于
      ocfs2_figure_merge_contig_type() still returns CONTIG_NONE when some error
      occurs which will cause an unpredictable error.  So return a proper errno
      when ocfs2_figure_merge_contig_type() fails.
      Signed-off-by: Njoyce.xue <xuejiufei@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9f99ad08
  25. 15 4月, 2015 3 次提交