04 Apr, 2014

3 commits

  • In ocfs2_info_handle_freeinode() and ocfs2_test_inode_bit() func, after
    calls ocfs2_get_system_file_inode() to get inode ref, if calls
    ocfs2_info_scan_inode_alloc() or ocfs2_inode_lock() failed, we should
    iput inode alloc to avoid leaking the inode.

    Signed-off-by: jiangyiwen
    Reviewed-by: Joseph Qi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    jiangyiwen
     
  • After updating alloc_dinode counts in ocfs2_alloc_dinode_update_counts(),
    if ocfs2_alloc_dinode_update_bitmap() failed, there is a rare case that
    some space may be lost.

    So, roll back alloc_dinode counts when ocfs2_block_group_set_bits()
    failed.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Younger Liu
    Reviewed-by: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Younger Liu
     
  • Ensure that ocfs2_update_inode_fsync_trans() is called any time we touch
    an inode in a given transaction. This is a follow-on to the previous
    patch to reduce lock contention and deadlocking during an fsync
    operation.

    Signed-off-by: Darrick J. Wong
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Wengang
    Cc: Greg Marsden
    Cc: Srinivas Eeda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     

22 Jan, 2014

1 commit


13 Nov, 2013

1 commit

  • The only reason for sb_getblk() failing is if it can't allocate the
    buffer_head. So return ENOMEM instead when it fails.

    [joseph.qi@huawei.com: ocfs2_symlink_get_block() and ocfs2_read_blocks_sync() and ocfs2_read_blocks() need the same change]
    Signed-off-by: Rui Xiang
    Reviewed-by: Jie Liu
    Reviewed-by: Mark Fasheh
    Cc: Joel Becker
    Cc: Joseph Qi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rui Xiang
     

04 Jul, 2013

2 commits

  • Cc: Jie Liu
    Cc: Joel Becker
    Cc: Mark Fasheh
    Cc: Sunil Mushran
    Cc: Younger Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • In ocfs2_relink_block_group(), we roll back all those changes if notify
    intent to modify buffers for metadata update failed even if the relevant
    buffer has not yet been modified/got dirty at that point, that are not
    quite right because of:

    - None buffer has been modified/dirty if failed to call
    ocfs2_journal_access_gd() against the previous block group buffer

    - Only the previous block group buffer has got dirty if failed to call
    ocfs2_journal_access_gd() against the block group buffer

    - There is no need to roll back the change for file entry buffer at all

    Those problems will not cause anything wrong but unnecessary. This
    patch fix them and kill the useless bg_ptr variable as well.

    Signed-off-by: Jie Liu
    Cc: Younger Liu
    Cc: Sunil Mushran
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jie Liu
     

28 Feb, 2013

1 commit

  • ocfs2_block_group_alloc_discontig() disables chain relink by setting
    ac->ac_allow_chain_relink = 0 because it grabs clusters from multiple
    cluster groups.

    It doesn't keep the credits for all chain relink,but
    ocfs2_claim_suballoc_bits overrides this in this call trace:
    ocfs2_block_group_claim_bits()->ocfs2_claim_clusters()->
    __ocfs2_claim_clusters()->ocfs2_claim_suballoc_bits()
    ocfs2_claim_suballoc_bits set ac->ac_allow_chain_relink = 1; then call
    ocfs2_search_chain() one time and disable it again, and then we run out
    of credits.

    Fix is to allow relink by default and disable it in
    ocfs2_block_group_alloc_discontig.

    Without this patch, End-users will run into a crash due to run out of
    credits, backtrace like this:

    RIP: 0010:[] []
    jbd2_journal_dirty_metadata+0x164/0x170 [jbd2]
    RSP: 0018:ffff8801b919b5b8 EFLAGS: 00010246
    RAX: 0000000000000000 RBX: ffff88022139ddc0 RCX: ffff880159f652d0
    RDX: ffff880178aa3000 RSI: ffff880159f652d0 RDI: ffff880087f09bf8
    RBP: ffff8801b919b5e8 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000001e00 R11: 00000000000150b0 R12: ffff880159f652d0
    R13: ffff8801a0cae908 R14: ffff880087f09bf8 R15: ffff88018d177800
    FS: 00007fc9b0b6b6e0(0000) GS:ffff88022fd40000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 000000000040819c CR3: 0000000184017000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process dd (pid: 9945, threadinfo ffff8801b919a000, task ffff880149a264c0)
    Call Trace:
    ocfs2_journal_dirty+0x2f/0x70 [ocfs2]
    ocfs2_relink_block_group+0x111/0x480 [ocfs2]
    ocfs2_search_chain+0x455/0x9a0 [ocfs2]
    ...

    Signed-off-by: Xiaowei.Hu
    Reviewed-by: Srinivas Eeda
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xiaowei.Hu
     

14 Apr, 2012

1 commit


31 Mar, 2011

1 commit


07 Mar, 2011

1 commit

  • mlog_exit is used to record the exit status of a function.
    But because it is added in so many functions, if we enable it,
    the system logs get filled up quickly and cause too much I/O.
    So actually no one can open it for a production system or even
    for a test.

    This patch just try to remove it or change it. So:
    1. if all the error paths already use mlog_errno, it is just removed.
    Otherwise, it will be replaced by mlog_errno.
    2. if it is used to print some return value, it is replaced with
    mlog(0,...).
    mlog_exit_ptr is changed to mlog(0.
    All those mlog(0,...) will be replaced with trace events later.

    Signed-off-by: Tao Ma

    Tao Ma
     

22 Feb, 2011

2 commits


21 Feb, 2011

1 commit

  • ENTRY is used to record the entry of a function.
    But because it is added in so many functions, if we enable it,
    the system logs get filled up quickly and cause too much I/O.
    So actually no one can open it for a production system or even
    for a test.

    So for mlog_entry_void, we just remove it.
    for mlog_entry(...), we replace it with mlog(0,...), and they
    will be replace by trace event later.

    Signed-off-by: Tao Ma

    Tao Ma
     

02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

16 Oct, 2010

1 commit


12 Oct, 2010

1 commit

  • This patch adds a safe check to ensure bg_free_bits_count doesn't exceed
    bg_bits in a group descriptor. This is to avoid on disk corruption that was
    seen recently.

    debugfs: group
    Group Chain: 179 Parent Inode: 11 Generation: 2959379682
    CRC32: 00000000 ECC: 0000
    ## Block# Total Used Free Contig Size
    0 52803072 32256 4294965350 34202 18207 4032
    ......

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Joel Becker

    Srinivas Eeda
     

24 Sep, 2010

1 commit


08 Sep, 2010

4 commits

  • This allows code which needs to know the eventual block number of an inode
    but can't allocate it yet due to transaction or lock ordering. For example,
    ocfs2_create_inode_in_orphan() currently gives a junk blkno for preparation
    of the orphan dir because it can't yet know where the actual inode is placed
    - that code is actually in ocfs2_mknod_locked. This is a problem when the
    orphan dirs are indexed as the junk inode number will create an index entry
    which goes unused (and fails the later removal from the orphan dir). Now
    with these interfaces, ocfs2_create_inode_in_orphan() can run the block
    group search (and get back the inode block number) *before* any actual
    allocation occurs.

    Signed-off-by: Mark Fasheh
    Signed-off-by: Tao Ma

    Mark Fasheh
     
  • ocfs2_search_chain() makes the same updates as
    ocfs2_alloc_dinode_update_counts to the alloc inode. Instead of open coding
    the bitmap update, use our helper function.

    Signed-off-by: Mark Fasheh
    Signed-off-by: Tao Ma

    Mark Fasheh
     
  • We were setting ac->ac_last_group in ocfs2_claim_suballoc_bits from
    res->sr_bg_blkno. Unfortunately, res->sr_bg_blkno is going to be zero under
    normal (non-fragmented) circumstances. The discontig block group patches
    effectively turned off that feature. Fix this by correctly calculating what
    the next group hint should be.

    Acked-by: Tao Ma
    Signed-off-by: Mark Fasheh
    Tested-by: Goldwyn Rodrigues
    Signed-off-by: Tao Ma

    Mark Fasheh
     
  • We have added discontig block group now, and now an inode
    can be allocated in an discontig block group. So get
    it in ocfs2_get_suballoc_slot_bit.

    The old ocfs2_test_suballoc_bit gets group block no
    from the allocation inode which is wrong. Fix it by
    passing the right group.

    Acked-by: Mark Fasheh
    Signed-off-by: Tao Ma

    Tao Ma
     

13 Jul, 2010

1 commit

  • In ocfs2_block_group_alloc, we set c_blkno by bg->bg_blkno.
    But actually bg->bg_blkno is already changed to little endian
    in ocfs2_block_group_fill. So remove the extra cpu_to_le64.

    Reported-by: Marcos Matsunaga
    Signed-off-by: Tao Ma
    Signed-off-by: Joel Becker

    Tao Ma
     

19 May, 2010

1 commit


06 May, 2010

3 commits


27 Apr, 2010

1 commit

  • ac_last_group is used to record the last block group we
    used during allocation. But the initialization process
    only calls ocfs2_which_suballoc_group and fails to
    use suballoc_loc properly. So let us do it.
    Another function ocfs2_test_suballoc_bit also needs fix.

    I have searched all the callers of ocfs2_which_suballoc_group,
    and all the callers notices suballoc_loc now.

    Signed-off-by: Tao Ma

    Tao Ma
     

22 Apr, 2010

1 commit


13 Apr, 2010

4 commits


26 Mar, 2010

6 commits


22 Mar, 2010

1 commit