07 Aug, 2015

2 commits

  • When using a large volume, for example 9T volume with 2T already used,
    frequent creation of small files with O_DIRECT when the IO is not
    cluster aligned may clear sectors in the wrong place. This will cause
    filesystem corruption.

    This is because p_cpos is a u32. When calculating the corresponding
    sector it should be converted to u64 first, otherwise it may overflow.

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

    Joseph Qi
     
  • The "BUG_ON(list_empty(&osb->blocked_lock_list))" in
    ocfs2_downconvert_thread_do_work can be triggered in the following case:

    ocfs2dc has firstly saved osb->blocked_lock_count to local varibale
    processed, and then processes the dentry lockres. During the dentry
    put, it calls iput and then deletes rw, inode and open lockres from
    blocked list in ocfs2_mark_lockres_freeing. And this causes the
    variable `processed' to not reflect the number of blocked lockres to be
    processed, which triggers the BUG.

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

    Joseph Qi
     

10 Jul, 2015

1 commit

  • The FITRIM ioctl has the same arguments on 32-bit and 64-bit
    architectures, so we can add it to the list of compatible ioctls and
    drop it from compat_ioctl method of various filesystems.

    Signed-off-by: Mikulas Patocka
    Cc: Al Viro
    Cc: Ted Ts'o
    Signed-off-by: Linus Torvalds

    Mikulas Patocka
     

26 Jun, 2015

1 commit

  • Pull cgroup writeback support from Jens Axboe:
    "This is the big pull request for adding cgroup writeback support.

    This code has been in development for a long time, and it has been
    simmering in for-next for a good chunk of this cycle too. This is one
    of those problems that has been talked about for at least half a
    decade, finally there's a solution and code to go with it.

    Also see last weeks writeup on LWN:

    http://lwn.net/Articles/648292/"

    * 'for-4.2/writeback' of git://git.kernel.dk/linux-block: (85 commits)
    writeback, blkio: add documentation for cgroup writeback support
    vfs, writeback: replace FS_CGROUP_WRITEBACK with SB_I_CGROUPWB
    writeback: do foreign inode detection iff cgroup writeback is enabled
    v9fs: fix error handling in v9fs_session_init()
    bdi: fix wrong error return value in cgwb_create()
    buffer: remove unusued 'ret' variable
    writeback: disassociate inodes from dying bdi_writebacks
    writeback: implement foreign cgroup inode bdi_writeback switching
    writeback: add lockdep annotation to inode_to_wb()
    writeback: use unlocked_inode_to_wb transaction in inode_congested()
    writeback: implement unlocked_inode_to_wb transaction and use it for stat updates
    writeback: implement [locked_]inode_to_wb_and_lock_list()
    writeback: implement foreign cgroup inode detection
    writeback: make writeback_control track the inode being written back
    writeback: relocate wb[_try]_get(), wb_put(), inode_{attach|detach}_wb()
    mm: vmscan: disable memcg direct reclaim stalling if cgroup writeback support is in use
    writeback: implement memcg writeback domain based throttling
    writeback: reset wb_domain->dirty_limit[_tstmp] when memcg domain size changes
    writeback: implement memcg wb_domain
    writeback: update wb_over_bg_thresh() to use wb_domain aware operations
    ...

    Linus Torvalds
     

25 Jun, 2015

16 commits

  • Some functions are only used locally, so mark them as static.

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

    Joseph Qi
     
  • Use kernel.h macro definition.

    Thanks to Julia Lawall for Coccinelle scripting support.

    Signed-off-by: Fabian Frederick
    Cc: Julia Lawall
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Use kernel.h macro definition.

    Thanks to Julia Lawall for Coccinelle scripting support.

    Signed-off-by: Fabian Frederick
    Cc: Julia Lawall
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Use kernel.h macro definition.

    Thanks to Julia Lawall for Coccinelle scripting support.

    Signed-off-by: Fabian Frederick
    Cc: Julia Lawall
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • contig_blocks gotten from ocfs2_extent_map_get_blocks cannot be compared
    with clusters_to_alloc. So convert it to clusters first.

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

    Joseph Qi
     
  • ocfs2_abort_trigger() use bh->b_assoc_map to get sb. But there's no
    function to set bh->b_assoc_map in ocfs2, it will trigger NULL pointer
    dereference while calling this function. We can get sb from
    bh->b_bdev->bd_super instead of b_assoc_map.

    [akpm@linux-foundation.org: update comment, per Joseph]
    Signed-off-by: joyce.xue
    Cc: Joseph Qi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • Signed-off-by: Alex Chen
    Reviewed-by: Joseph Qi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    alex chen
     
  • In ocfs2 direct read/write, OCFS2_IOCB_SEM lock type is used to protect
    inode->i_alloc_sem rw semaphore lock in the earlier kernel version.
    However, in the latest kernel, inode->i_alloc_sem rw semaphore lock is not
    used at all, so OCFS2_IOCB_SEM lock type needs to be removed.

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

    WeiWei Wang
     
  • jbd2_journal_dirty_metadata may fail. Currently it cannot take care of
    non zero return value and just BUG in ocfs2_journal_dirty. This patch is
    aborting the handle and journal instead of BUG.

    Signed-off-by: Joseph Qi
    Cc: joyce.xue
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Junxiao Bi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joseph Qi
     
  • 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: joyce.xue
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: joyce.xue
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xue jiufei
     
  • __dlm_wait_on_lockres_flags_set() is declared but not implemented and
    used. So remove it.

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

    Joseph Qi
     
  • The use of 'status' in __ocfs2_add_entry() can return wrong value.

    Some functions' return value in __ocfs2_add_entry(), i.e
    ocfs2_journal_access_di() is saved to 'status'. But 'status' is not
    used in 'bail' label for returning result of __ocfs2_add_entry().

    So use retval instead of status.

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

    Daeseok Youn
     
  • Once dio crashed it will leave an entry in orphan dir. And orphan scan
    will take care of the clean up. There is a tiny race case that the same
    entry will be truncated twice and then trigger the BUG in
    ocfs2_del_inode_from_orphan.

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

    Joseph Qi
     
  • raw_smp_processor_id() is the means of avoiding the runtime preemptibility
    check.

    [akpm@linux-foundation.org: fix printk warning]
    Cc: Joe Perches
    Cc: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Using a function for __mlog_printk instead of a macro reduces the object
    size of built-in.o by about 190KB, or ~18% overall (x86-64 defconfig
    with all ocfs2 options)

    $ size fs/ocfs2/built-in.o*
    text data bss dec hex filename
    870954 118471 134408 1123833 1125f9 fs/ocfs2/built-in.o,new
    1064081 118071 134408 1316560 1416d0 fs/ocfs2/built-in.o.old

    Miscellanea:

    - Move the used-once __mlog_cpu_guess statement expression macro to the
    masklog.c file above the use in __mlog_printk function

    - Simplify the mlog macro moving the and/or logic and level code into
    __mlog_printk

    [akpm@linux-foundation.org: export __mlog_printk() to other ocfs2 modules]
    Signed-off-by: Joe Perches
    Cc: Joel Becker
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

02 Jun, 2015

1 commit

  • With the planned cgroup writeback support, backing-dev related
    declarations will be more widely used across block and cgroup;
    unfortunately, including backing-dev.h from include/linux/blkdev.h
    makes cyclic include dependency quite likely.

    This patch separates out backing-dev-defs.h which only has the
    essential definitions and updates blkdev.h to include it. c files
    which need access to more backing-dev details now include
    backing-dev.h directly. This takes backing-dev.h off the common
    include dependency chain making it a lot easier to use it across block
    and cgroup.

    v2: fs/fat build failure fixed.

    Signed-off-by: Tejun Heo
    Reviewed-by: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Jens Axboe

    Tejun Heo
     

06 May, 2015

1 commit

  • There is a race window in dlm_get_lock_resource(), which may return a
    lock resource which has been purged. This will cause the process to
    hang forever in dlmlock() as the ast msg can't be handled due to its
    lock resource not existing.

    dlm_get_lock_resource {
    ...
    spin_lock(&dlm->spinlock);
    tmpres = __dlm_lookup_lockres_full(dlm, lockid, namelen, hash);
    if (tmpres) {
    spin_unlock(&dlm->spinlock);
    >>>>>>>> race window, dlm_run_purge_list() may run and purge
    the lock resource
    spin_lock(&tmpres->spinlock);
    ...
    spin_unlock(&tmpres->spinlock);
    }
    }

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

    Junxiao Bi
     

27 Apr, 2015

1 commit

  • Pull fourth vfs update from Al Viro:
    "d_inode() annotations from David Howells (sat in for-next since before
    the beginning of merge window) + four assorted fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    RCU pathwalk breakage when running into a symlink overmounting something
    fix I_DIO_WAKEUP definition
    direct-io: only inc/dec inode->i_dio_count for file systems
    fs/9p: fix readdir()
    VFS: assorted d_backing_inode() annotations
    VFS: fs/inode.c helpers: d_inode() annotations
    VFS: fs/cachefiles: d_backing_inode() annotations
    VFS: fs library helpers: d_inode() annotations
    VFS: assorted weird filesystems: d_inode() annotations
    VFS: normal filesystems (and lustre): d_inode() annotations
    VFS: security/: d_inode() annotations
    VFS: security/: d_backing_inode() annotations
    VFS: net/: d_inode() annotations
    VFS: net/unix: d_backing_inode() annotations
    VFS: kernel/: d_inode() annotations
    VFS: audit: d_backing_inode() annotations
    VFS: Fix up some ->d_inode accesses in the chelsio driver
    VFS: Cachefiles should perform fs modifications on the top layer only
    VFS: AF_UNIX sockets should call mknod on the top layer only

    Linus Torvalds
     

22 Apr, 2015

1 commit

  • This reverts commit e2ac55b6a8e337fac7cc59c6f452caac92ab5ee6.

    Huang Ying reports that this causes a hang at boot with debugfs disabled.

    It is true that the debugfs error checks are kind of confusing, and this
    code certainly merits more cleanup and thinking about it, but there's
    something wrong with the trivial "check not just for NULL, but for error
    pointers too" patch.

    Yes, with debugfs disabled, we will end up setting the o2hb_debug_dir
    pointer variable to an error pointer (-ENODEV), and then continue as if
    everything was fine. But since debugfs is disabled, all the _users_ of
    that pointer end up being compiled away, so even though the pointer can
    not be dereferenced, that's still fine.

    So it's confusing and somewhat questionable, but the "more correct"
    error checks end up causing more trouble than they fix.

    Reported-by: Huang Ying
    Acked-by: Andrew Morton
    Acked-by: Chengyu Song
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

17 Apr, 2015

1 commit

  • Pull third hunk of vfs changes from Al Viro:
    "This contains the ->direct_IO() changes from Omar + saner
    generic_write_checks() + dealing with fcntl()/{read,write}() races
    (mirroring O_APPEND/O_DIRECT into iocb->ki_flags and instead of
    repeatedly looking at ->f_flags, which can be changed by fcntl(2),
    check ->ki_flags - which cannot) + infrastructure bits for dhowells'
    d_inode annotations + Christophs switch of /dev/loop to
    vfs_iter_write()"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (30 commits)
    block: loop: switch to VFS ITER_BVEC
    configfs: Fix inconsistent use of file_inode() vs file->f_path.dentry->d_inode
    VFS: Make pathwalk use d_is_reg() rather than S_ISREG()
    VFS: Fix up debugfs to use d_is_dir() in place of S_ISDIR()
    VFS: Combine inode checks with d_is_negative() and d_is_positive() in pathwalk
    NFS: Don't use d_inode as a variable name
    VFS: Impose ordering on accesses of d_inode and d_flags
    VFS: Add owner-filesystem positive/negative dentry checks
    nfs: generic_write_checks() shouldn't be done on swapout...
    ocfs2: use __generic_file_write_iter()
    mirror O_APPEND and O_DIRECT into iocb->ki_flags
    switch generic_write_checks() to iocb and iter
    ocfs2: move generic_write_checks() before the alignment checks
    ocfs2_file_write_iter: stop messing with ppos
    udf_file_write_iter: reorder and simplify
    fuse: ->direct_IO() doesn't need generic_write_checks()
    ext4_file_write_iter: move generic_write_checks() up
    xfs_file_aio_write_checks: switch to iocb/iov_iter
    generic_write_checks(): drop isblk argument
    blkdev_write_iter: expand generic_file_checks() call in there
    ...

    Linus Torvalds
     

16 Apr, 2015

2 commits

  • Pull second vfs update from Al Viro:
    "Now that net-next went in... Here's the next big chunk - killing
    ->aio_read() and ->aio_write().

    There'll be one more pile today (direct_IO changes and
    generic_write_checks() cleanups/fixes), but I'd prefer to keep that
    one separate"

    * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits)
    ->aio_read and ->aio_write removed
    pcm: another weird API abuse
    infinibad: weird APIs switched to ->write_iter()
    kill do_sync_read/do_sync_write
    fuse: use iov_iter_get_pages() for non-splice path
    fuse: switch to ->read_iter/->write_iter
    switch drivers/char/mem.c to ->read_iter/->write_iter
    make new_sync_{read,write}() static
    coredump: accept any write method
    switch /dev/loop to vfs_iter_write()
    serial2002: switch to __vfs_read/__vfs_write
    ashmem: use __vfs_read()
    export __vfs_read()
    autofs: switch to __vfs_write()
    new helper: __vfs_write()
    switch hugetlbfs to ->read_iter()
    coda: switch to ->read_iter/->write_iter
    ncpfs: switch to ->read_iter/->write_iter
    net/9p: remove (now-)unused helpers
    p9_client_attach(): set fid->uid correctly
    ...

    Linus Torvalds
     
  • that's the bulk of filesystem drivers dealing with inodes of their own

    Signed-off-by: David Howells
    Signed-off-by: Al Viro

    David Howells
     

15 Apr, 2015

13 commits

  • Merge first patchbomb from Andrew Morton:

    - arch/sh updates

    - ocfs2 updates

    - kernel/watchdog feature

    - about half of mm/

    * emailed patches from Andrew Morton : (122 commits)
    Documentation: update arch list in the 'memtest' entry
    Kconfig: memtest: update number of test patterns up to 17
    arm: add support for memtest
    arm64: add support for memtest
    memtest: use phys_addr_t for physical addresses
    mm: move memtest under mm
    mm, hugetlb: abort __get_user_pages if current has been oom killed
    mm, mempool: do not allow atomic resizing
    memcg: print cgroup information when system panics due to panic_on_oom
    mm: numa: remove migrate_ratelimited
    mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE
    mm: split ET_DYN ASLR from mmap ASLR
    s390: redefine randomize_et_dyn for ELF_ET_DYN_BASE
    mm: expose arch_mmap_rnd when available
    s390: standardize mmap_rnd() usage
    powerpc: standardize mmap_rnd() usage
    mips: extract logic for mmap_rnd()
    arm64: standardize mmap_rnd() usage
    x86: standardize mmap_rnd() usage
    arm: factor out mmap ASLR into mmap_rnd
    ...

    Linus Torvalds
     
  • Use super_block->s_uuid instead. Every shared filesystem using cleancache
    must now initialize super_block->s_uuid before calling
    cleancache_init_shared_fs. The only one on the tree, ocfs2, already meets
    this requirement.

    Signed-off-by: Vladimir Davydov
    Cc: Konrad Rzeszutek Wilk
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Stefan Hengelein
    Cc: Florian Schmaus
    Cc: Andor Daam
    Cc: Dan Magenheimer
    Cc: Bob Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     
  • Currently, maximal number of cleancache enabled filesystems equals 32,
    which is insufficient nowadays, because a Linux host can have hundreds
    of containers on board, each of which might want its own filesystem.
    This patch set targets at removing this limitation - see patch 4 for
    more details. Patches 1-3 prepare the code for this change.

    This patch (of 4):

    This will allow us to remove the uuid argument from
    cleancache_init_shared_fs.

    Signed-off-by: Vladimir Davydov
    Cc: Konrad Rzeszutek Wilk
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Stefan Hengelein
    Cc: Florian Schmaus
    Cc: Andor Daam
    Cc: Dan Magenheimer
    Cc: Bob Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Davydov
     
  • ocfs2 does

    mlog_errno(v);
    return v;

    in many places. Change mlog_errno() so we can do

    return mlog_errno(v);

    For some weird reason this patch reduces the size of ocfs2 by 6k:

    akpm3:/usr/src/25> size fs/ocfs2/ocfs2.ko
    text data bss dec hex filename
    1146613 82767 832192 2061572 1f7504 fs/ocfs2/ocfs2.ko-before
    1140857 82767 832192 2055816 1f5e88 fs/ocfs2/ocfs2.ko-after

    [dan.carpenter@oracle.com: double evaluation concerns in mlog_errno()]
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: alex chen
    Signed-off-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • If ocfs2 lockres has not been initialized before calling ocfs2_dlm_lock,
    the lock won't be dropped and then will lead umount hung. The case is
    described below:

    ocfs2_mknod
    ocfs2_mknod_locked
    __ocfs2_mknod_locked
    ocfs2_journal_access_di
    Failed because of -ENOMEM or other reasons, the inode lockres
    has not been initialized yet.

    iput(inode)
    ocfs2_evict_inode
    ocfs2_delete_inode
    ocfs2_inode_lock
    ocfs2_inode_lock_full_nested
    __ocfs2_cluster_lock
    Succeeds and allocates a new dlm lockres.
    ocfs2_clear_inode
    ocfs2_open_unlock
    ocfs2_drop_inode_locks
    ocfs2_drop_lock
    Since lockres has not been initialized, the lock
    can't be dropped and the lockres can't be
    migrated, thus umount will hang forever.

    Signed-off-by: Alex Chen
    Reviewed-by: Joseph Qi
    Reviewed-by: joyce.xue
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    alex chen
     
  • Use the vsprintf %pV extension to avoid using a static buffer and remove
    the now unnecessary buffer.

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

    Joe Perches
     
  • debugfs_create_dir and debugfs_create_file may return -ENODEV when debugfs
    is not configured, so the return value should be checked against
    ERROR_VALUE as well, otherwise the later dereference of the dentry pointer
    would crash the kernel.

    This patch tries to solve this problem by fixing certain checks. However,
    I have that found other call sites are protected by #ifdef CONFIG_DEBUG_FS.
    In current implementation, if CONFIG_DEBUG_FS is defined, then the above
    two functions will never return any ERROR_VALUE. So another possibility
    to fix this is to surround all the buggy checks/functions with the same
    #ifdef CONFIG_DEBUG_FS. But I'm not sure if this would break any functionality,
    as only OCFS2_FS_STATS declares dependency on DEBUG_FS.

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

    Chengyu Song
     
  • Signed-off-by: Jakub Wilk
    Reviewed-by: Eric Ren
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jakub Wilk
     
  • In ocfs2_local_alloc_find_clear_bits and ocfs2_get_dentry, variable
    numfound and set may be uninitialized and then used in tracepoint. In
    ocfs2_xattr_block_get and ocfs2_delete_xattr_in_bucket, variable block_off
    and xv may be uninitialized and then used in the following logic due to
    unchecked return value.

    This patch fixes these possible issues.

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

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

    Daeseok Youn
     
  • ocfs2_block_group_clear_bits will clear bits in block group bitmap.
    Once it succeeds but fails in the following step, it will cause block
    group bitmap mismatch the corresponding count recorded in dinode.
    So rollback the cleared bits if error occurs.

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

    Joseph Qi
     
  • When ocfs2_get_system_file_inode fails, it is obscure to set the return
    value to -EEXIST. So change it to -ENOENT.

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

    Joseph Qi
     
  • If the namelen is 20 and name only has actual length 16, it will fail in
    ocfs2_find_entry because of mismatch. So use actual name length when find
    entry.

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

    Joseph Qi