15 Nov, 2013

1 commit


13 Nov, 2013

17 commits

  • Merge first patch-bomb from Andrew Morton:
    "Quite a lot of other stuff is banked up awaiting further
    next->mainline merging, but this batch contains:

    - Lots of random misc patches
    - OCFS2
    - Most of MM
    - backlight updates
    - lib/ updates
    - printk updates
    - checkpatch updates
    - epoll tweaking
    - rtc updates
    - hfs
    - hfsplus
    - documentation
    - procfs
    - update gcov to gcc-4.7 format
    - IPC"

    * emailed patches from Andrew Morton : (269 commits)
    ipc, msg: fix message length check for negative values
    ipc/util.c: remove unnecessary work pending test
    devpts: plug the memory leak in kill_sb
    ./Makefile: export initial ramdisk compression config option
    init/Kconfig: add option to disable kernel compression
    drivers: w1: make w1_slave::flags long to avoid memory corruption
    drivers/w1/masters/ds1wm.cuse dev_get_platdata()
    drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page()
    drivers/memstick/core/mspro_block.c: fix attributes array allocation
    drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr
    kernel/panic.c: reduce 1 byte usage for print tainted buffer
    gcov: reuse kbasename helper
    kernel/gcov/fs.c: use pr_warn()
    kernel/module.c: use pr_foo()
    gcov: compile specific gcov implementation based on gcc version
    gcov: add support for gcc 4.7 gcov format
    gcov: move gcov structs definitions to a gcc version specific file
    kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener()
    kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end()
    kernel/sysctl_binary.c: use scnprintf() instead of snprintf()
    ...

    Linus Torvalds
     
  • Ocfs2 doesn't do data journalling. Thus its ->invalidatepage and
    ->releasepage functions never get called on buffers that have journal
    heads attached. So just use standard variants of functions from
    buffer.c.

    Signed-off-by: Jan Kara
    Cc: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • This typedef is unnecessary and should just be removed.

    Signed-off-by: Joe Perches
    Cc: Mark Fasheh
    Acked-by: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • When ocfs2_write_cluster_by_desc() failed in ocfs2_write_begin_nolock()
    because of ENOSPC, it goes to out_quota, freeing data_ac(meta_ac). Then
    it calls ocfs2_try_to_free_truncate_log() to free space. If enough
    space freed, it will try to write again. Unfortunately, some error
    happenes before ocfs2_lock_allocators(), it goes to out and free
    data_ac(meta_ac) again.

    Signed-off-by: joyce
    Reviewed-by: Jie Liu
    Acked-by: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • If the file is not regular or writeable, it should return errno(EPERM).

    This patch is based on 85a258b70d ("ocfs2: fix error handling in
    ocfs2_ioctl_move_extents()").

    Signed-off-by: Younger Liu
    Signed-off-by: Jie Liu
    Reviewed-by: Dan Carpenter
    Reviewed-by: Jie Liu
    Cc: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Younger Liu
     
  • If group_bh is not initialized, there is no need to release. This
    problem does not cause anything wrong, but the patch would make the code
    more logical.

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

    Younger Liu
     
  • If ocfs2_journal_access_di() fails, group->bg_next_group should rollback.
    Otherwise, there would be a inconsistency between group_bh and main_bm_bh.

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

    Younger Liu
     
  • Signed-off-by: Junxiao Bi
    Signed-off-by: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Junxiao Bi
     
  • We already have find_last_bit(). So just use it as described in the
    comment.

    Signed-off-by: Akinobu Mita
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • We trigger a bug in __dlm_lockres_reserve_ast() when we parallel umount 4
    nodes. The situation is as follows:

    1) Node A migrate all lockres it owned(eg. lockres A) to other nodes
    say node B when it umounts.

    2) Receiving MIG_LOCKRES message from A, Node B masters the lockres A
    with DLM_LOCK_RES_MIGRATING state set.

    3) Then we umount ocfs2 on node B. It also should migrate lockres A to
    another node, say node C. But now, DLM_LOCK_RES_MIGRATING state of
    lockers A is not cleared. Node B triggered the BUG on lockres with
    state DLM_LOCK_RES_MIGRATING.

    Signed-off-by: Xuejiufei
    Signed-off-by: Joel Becker
    Cc: Mark Fasheh
    Cc: Tariq Saeed
    Cc: Srinivas Eeda
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • A parallel umount on 4 nodes triggered a bug in
    dlm_process_recovery_date(). Here's the situation:

    Receiving MIG_LOCKRES message, A node processes the locks in migratable
    lockres. It copys lvb from migratable lockres when processing the first
    valid lock.

    If there is a lock in the blocked list with the EX level, it triggers the
    BUG. Since valid lvbs are set when locks are granted with EX or PR
    levels, locks in the blocked list cannot have valid lvbs. Therefore I
    think we should skip the locks in the blocked list.

    Signed-off-by: Xuejiufei
    Signed-off-by: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • Use bitmap_weight() instead of reinventing the wheel.

    Signed-off-by: Akinobu Mita
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • -EDQUOT is a user-visible error, not a logic problem. Teach mlog_errno()
    to ignore it like it ignores -ENOSPC, etc.

    Signed-off-by: Joel Becker
    Reviewed-by: Jan Kara
    Reported-by: Marek Królikowski
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joel Becker
     
  • sb_getblk() may return an err, so add a check for bh.

    [joseph.qi@huawei.com: also add a check after calling sb_getblk() in ocfs2_create_xattr_block()]
    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
     
  • 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
     
  • Unwritten extent only exists for file systems which support holes. But
    the comment said was opposite meaning and also the comment is not very
    clear, so rephase it.

    Signed-off-by: Junxiao Bi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Junxiao Bi
     
  • Code cleanup to remove unnecessary variable passed but never used
    to ocfs2_calc_extend_credits.

    Signed-off-by: Goldwyn Rodrigues
    Cc: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Goldwyn Rodrigues
     

09 Nov, 2013

1 commit


30 Sep, 2013

1 commit


25 Sep, 2013

1 commit


14 Sep, 2013

1 commit

  • Pull aio changes from Ben LaHaise:
    "First off, sorry for this pull request being late in the merge window.
    Al had raised a couple of concerns about 2 items in the series below.
    I addressed the first issue (the race introduced by Gu's use of
    mm_populate()), but he has not provided any further details on how he
    wants to rework the anon_inode.c changes (which were sent out months
    ago but have yet to be commented on).

    The bulk of the changes have been sitting in the -next tree for a few
    months, with all the issues raised being addressed"

    * git://git.kvack.org/~bcrl/aio-next: (22 commits)
    aio: rcu_read_lock protection for new rcu_dereference calls
    aio: fix race in ring buffer page lookup introduced by page migration support
    aio: fix rcu sparse warnings introduced by ioctx table lookup patch
    aio: remove unnecessary debugging from aio_free_ring()
    aio: table lookup: verify ctx pointer
    staging/lustre: kiocb->ki_left is removed
    aio: fix error handling and rcu usage in "convert the ioctx list to table lookup v3"
    aio: be defensive to ensure request batching is non-zero instead of BUG_ON()
    aio: convert the ioctx list to table lookup v3
    aio: double aio_max_nr in calculations
    aio: Kill ki_dtor
    aio: Kill ki_users
    aio: Kill unneeded kiocb members
    aio: Kill aio_rw_vect_retry()
    aio: Don't use ctx->tail unnecessarily
    aio: io_cancel() no longer returns the io_event
    aio: percpu ioctx refcount
    aio: percpu reqs_available
    aio: reqs_active -> reqs_available
    aio: fix build when migration is disabled
    ...

    Linus Torvalds
     

12 Sep, 2013

18 commits

  • Call fiemap ioctl(2) with given start offset as well as an desired mapping
    range should show extents if possible. However, we somehow figure out the
    end offset of mapping via 'mapping_end -= cpos' before iterating the
    extent records which would cause problems if the given fiemap length is
    too small to a cluster size, e.g,

    Cluster size 4096:
    debugfs.ocfs2 1.6.3
    Block Size Bits: 12 Cluster Size Bits: 12

    The extended fiemap test utility From David:
    https://gist.github.com/anonymous/6172331

    # dd if=/dev/urandom of=/ocfs2/test_file bs=1M count=1000
    # ./fiemap /ocfs2/test_file 4096 10
    start: 4096, length: 10
    File /ocfs2/test_file has 0 extents:
    # Logical Physical Length Flags
    ^^^^^
    Reported-by: David Weber
    Tested-by: David Weber
    Cc: Sunil Mushran
    Cc: Mark Fashen
    Cc: Joel Becker
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jie Liu
     
  • Variable ip in dlmfs_get_root_inode() is defined but not used. So clean
    it up.

    Signed-off-by: Joseph Qi
    Reviewed-by: Jie Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joseph Qi
     
  • In o2hb_shutdown_slot() and o2hb_check_slot(), since event is defined as
    local, it is only valid during the call stack. So the following tiny race
    case may happen in a multi-volumes mounted environment:

    o2hb-vol1 o2hb-vol2
    1) o2hb_shutdown_slot
    allocate local event1
    2) queue_node_event
    add event1 to global o2hb_node_events
    3) o2hb_shutdown_slot
    allocate local event2
    4) queue_node_event
    add event2 to global o2hb_node_events
    5) o2hb_run_event_list
    delete event1 from o2hb_node_events
    6) o2hb_run_event_list
    event1 empty, return
    7) o2hb_shutdown_slot
    event1 lifecycle ends
    8) o2hb_fire_callbacks
    event1 is already *invalid*

    This patch lets it wait on o2hb_callback_sem when another thread is firing
    callbacks. And for performance consideration, we only call
    o2hb_run_event_list when there is an event queued.

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

    Joyce
     
  • Since o2nm_get_node_by_num() may return NULL, we add this check in
    o2net_accept_one() to avoid possible NULL pointer dereference.

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

    Joseph Qi
     
  • Code in o2net_handler_tree_lookup() may be corrupted by mistake. So
    adjust it to promote readability.

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

    Joseph Qi
     
  • In ocfs2_remove_inode_range(), there is a memory leak. The variable path
    has allocated memory with ocfs2_new_path_from_et(), but it is not free.

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

    Younger Liu
     
  • In ocfs2_reflink_xattr_rec(), meta_ac and data_ac are allocated by calling
    ocfs2_lock_reflink_xattr_rec_allocators().

    Once an error occurs when allocating *data_ac, it frees *meta_ac which is
    allocated before. Here it mistakenly sets meta_ac to NULL but *meta_ac.
    Then ocfs2_reflink_xattr_rec() will try to free meta_ac again which is
    already invalid.

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

    Joseph Qi
     
  • dlm_do_local_recovery_cleanup() should force clean refmap if the owner of
    lockres is UNKNOWN. Otherwise node may hang when umounting filesystems.
    Here's the situation:

    Node1 Node2
    dlmlock()
    -> dlm_get_lock_resource()
    send DLM_MASTER_REQUEST_MSG to
    other nodes.

    trying to master this lockres,
    return MAYBE.

    selected as the master of lockresA,
    set mle->master to Node1,
    and do assert_master,
    send DLM_ASSERT_MASTER_MSG to Node2.
    Node 2 has interest on lockresA
    and return
    DLM_ASSERT_RESPONSE_MASTERY_REF
    then something happened and
    Node2 crashed.

    Receiving DLM_ASSERT_RESPONSE_MASTERY_REF, set Node2 into refmap, and keep
    sending DLM_ASSERT_MASTER_MSG to other nodes

    o2hb found node2 down, calling dlm_hb_node_down() -->
    dlm_do_local_recovery_cleanup() the master of lockresA is still UNKNOWN,
    no need to call dlm_free_dead_locks().

    Set the master of lockresA to Node1, but Node2 stills remains in refmap.

    When Node1 umount, it found that the refmap of lockresA is not empty and
    attempted to migrate it to Node2, But Node2 is already down, so umount
    hang, trying to migrate lockresA again and again.

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

    Xue jiufei
     
  • In ocfs2_xattr_set(), if ocfs2_start_trans failed, meta_ac and data_ac
    should be free. Otherwise, It would lead to a memory leak.

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

    Younger Liu
     
  • In ocfs2_xattr_value_attach_refcount(), if error occurs when calling
    ocfs2_xattr_get_clusters(), it will go with unexpected behavior since
    local variables p_cluster, num_clusters and ext_flags are declared without
    initialization.

    Signed-off-by: Joseph Qi
    Cc: Joel Becker
    Cc: Mark Fasheh
    Acked-by: Jie Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joseph Qi
     
  • The ocfs2 path is not properly freed which leads to a memory leak at
    __ocfs2_move_extents().

    This patch stops the leaks of the ocfs2_path structure.

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

    Jie Liu
     
  • In ocfs2_attach_refcount_tree() and ocfs2_duplicate_extent_list(), if
    error occurs when calling ocfs2_get_clusters(), it will go with
    unexpected behavior as local variables p_cluster, num_clusters and
    ext_flags are declared without initialization.

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

    Joseph Qi
     
  • In ocfs2_acl_from_xattr(), if size is less than sizeof(struct
    posix_acl_entry), it returns ERR_PTR(-EINVAL) directly. Then assign (size
    / sizeof(struct posix_acl_entry)) to count which will be at least 1, that
    means the following branch (count < 0) and (count == 0) will never be
    true.

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

    Joseph Qi
     
  • [dan.carpenter@oracle.com: fix up some NULL dereference bugs]
    Signed-off-by: Dong Fang
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Jeff Liu
    Signed-off-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dong Fang
     
  • Fix some possible null pointer dereferences that were detected by the
    static code analyser, smatch.

    Signed-off-by: Sunil Mushran
    Reported-by: Dan Carpenter
    Reported-by: Guozhonghua
    Cc: Sunil Mushran
    Cc: Joseph Qi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sunil Mushran
     
  • There is an issue in reserving and claiming space for localalloc, When
    localalloc space is not enough, it would claim space from global_bitmap.
    And if there is not enough free space in global_bitmap, the size of
    claiming space would set to half of orignal size and retry.

    The issue is as follows: osb->local_alloc_bits is set to half of orignal
    size in ocfs2_recalc_la_window(), but ac->ac_bits_wanted is set to
    osb->local_alloc_default_bits which is not changed. localalloc always
    reserves and claims local_alloc_default_bits space and returns ENOSPC.

    So, ac->ac_bits_wanted should be osb->local_alloc_bits which would be
    changed.

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

    Younger Liu
     
  • dlm_request_all_locks() should deal with the status sent from target node
    if DLM_LOCK_REQUEST_MSG is sent successfully, or recovery master will fall
    into endless loop, waiting for other nodes to send locks and
    DLM_RECO_DATA_DONE_MSG to me.

    NodeA NodeB
    selected as recovery master
    dlm_remaster_locks()
    ->dlm_request_all_locks()
    send DLM_LOCK_REQUEST_MSG to nodeA

    It happened that NodeA cannot alloc memory when it processes this
    message. dlm_request_all_locks_handler() do not queue
    dlm_request_all_locks_worker and returns -ENOMEM. It will never send
    locks and DLM_RECO_DATA_DONE_MSG to NodeB.

    NodeB do not deal with the status
    sent from nodeA, and will fall in
    endless loop waiting for the
    recovery state of NodeA to be
    changed.

    Signed-off-by: joyce
    Cc: Mark Fasheh
    Cc: Jeff Liu
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • Though ocfs2 uses inode->i_mutex to protect i_size, there are both
    i_size_read/write() and direct accesses. Clean up all direct access to
    eliminate confusion.

    Signed-off-by: Junxiao Bi
    Cc: Jie Liu
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Junxiao Bi