23 Jan, 2016

1 commit

  • 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: Al Viro

    Al Viro
     

07 Nov, 2015

3 commits

  • To make ubifs support atime flexily, this commit introduces
    a Kconfig option named as UBIFS_ATIME_SUPPORT.

    With UBIFS_ATIME_SUPPORT=n:
    ubifs keeps the full compatibility to no_atime from
    the start of ubifs.

    =================UBIFS_ATIME_SUPPORT=n=======================
    -o - no atime
    -o atime - no atime
    -o noatime - no atime
    -o relatime - no atime
    -o strictatime - no atime
    -o lazyatime - no atime

    With UBIFS_ATIME_SUPPORT=y:
    ubifs supports the atime same with other main stream
    file systems.
    =================UBIFS_ATIME_SUPPORT=y=======================
    -o - default behavior (relatime currently)
    -o atime - atime support
    -o noatime - no atime support
    -o relatime - relative atime support
    -o strictatime - strict atime support
    -o lazyatime - lazy atime support

    Signed-off-by: Dongsheng Yang
    Reviewed-by: Richard Weinberger
    Signed-off-by: Richard Weinberger

    Dongsheng Yang
     
  • If ubifs_tnc_next_ent() returns something else than -ENOENT
    we leak file->private_data.

    Signed-off-by: Richard Weinberger
    Reviewed-by: David Gstir

    Richard Weinberger
     
  • As currently new_valid_dev always returns 1, so new_valid_dev check is not
    needed, remove it.

    Signed-off-by: Yaowei Bai
    Reviewed-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Richard Weinberger

    Yaowei Bai
     

11 May, 2015

1 commit


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
     

16 Apr, 2015

1 commit


13 Apr, 2015

1 commit

  • The INUM_WATERMARK is a unsigned 32bit value, `%d' prints it as negatave:
    [ 103.682255] UBIFS warning (ubi0:0 pid 691): ubifs_new_inode: running out of inode numbers (current 122763, max -256)

    Fix it as:
    [ 154.422940] UBIFS warning (ubi0:0 pid 688): ubifs_new_inode: running out of inode numbers (current 122765, max 4294967040)

    Signed-off-by: Sheng Yong
    Signed-off-by: Artem Bityutskiy

    Sheng Yong
     

25 Mar, 2015

2 commits

  • In the case where we have more than one volumes on different UBI
    devices, it may be not that easy to tell which volume prints the
    messages. Add ubi number and volume id in ubifs_msg/warn/error
    to help debug. These two values are passed by struct ubifs_info.

    For those where ubifs_info is not initialized yet, ubifs_* is
    replaced by pr_*. For those where ubifs_info is not avaliable,
    ubifs_info is passed to the calling function as a const parameter.

    The output looks like,

    [ 95.444879] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 696
    [ 95.484688] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "test1"
    [ 95.484694] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [ 95.484699] UBIFS (ubi0:1): FS size: 30220288 bytes (28 MiB, 238 LEBs), journal size 1523712 bytes (1 MiB, 12 LEBs)
    [ 95.484703] UBIFS (ubi0:1): reserved for root: 1427378 bytes (1393 KiB)
    [ 95.484709] UBIFS (ubi0:1): media format: w4/r0 (latest is w4/r0), UUID 40DFFC0E-70BE-4193-8905-F7D6DFE60B17, small LPT model
    [ 95.489875] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 699
    [ 95.529713] UBIFS (ubi1:0): UBIFS: mounted UBI device 1, volume 0, name "test2"
    [ 95.529718] UBIFS (ubi1:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [ 95.529724] UBIFS (ubi1:0): FS size: 19808256 bytes (18 MiB, 156 LEBs), journal size 1015809 bytes (0 MiB, 8 LEBs)
    [ 95.529727] UBIFS (ubi1:0): reserved for root: 935592 bytes (913 KiB)
    [ 95.529733] UBIFS (ubi1:0): media format: w4/r0 (latest is w4/r0), UUID EEB7779D-F419-4CA9-811B-831CAC7233D4, small LPT model

    [ 954.264767] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node type (255 but expected 6)
    [ 954.367030] UBIFS error (ubi1:0 pid 756): ubifs_read_node: bad node at LEB 0:0, LEB mapping status 1

    Signed-off-by: Sheng Yong
    Signed-off-by: Artem Bityutskiy

    Sheng Yong
     
  • When ubifs_init_security() fails, 'ui_mutex' is incorrectly
    unlocked and incorrectly restores 'i_size'. Fix this.

    Signed-off-by: Taesoo Kim
    Fixes: d7f0b70d30ff ("UBIFS: Add security.* XATTR support for the UBIFS")
    Reviewed-by: Ben Shelton
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Artem Bityutskiy

    Taesoo Kim
     

16 Feb, 2015

1 commit

  • Pull UBI and UBIFS updates from Richard Weinberger:
    - cleanups and bug fixes all over UBI and UBIFS
    - block-mq support for UBI Block
    - UBI volumes can now be renamed while they are in use
    - security.* XATTR support for UBIFS
    - a maintainer update

    * 'for-linus-v3.20' of git://git.infradead.org/linux-ubifs:
    UBI: block: Fix checking for NULL instead of IS_ERR()
    UBI: block: Continue creating ubiblocks after an initialization error
    UBIFS: return -EINVAL if log head is empty
    UBI: Block: Explain usage of blk_rq_map_sg()
    UBI: fix soft lockup in ubi_check_volume()
    UBI: Fastmap: Care about the protection queue
    UBIFS: add a couple of extra asserts
    UBI: do propagate positive error codes up
    UBI: clean-up printing helpers
    UBI: extend UBI layer debug/messaging capabilities - cosmetics
    UBIFS: add ubifs_err() to print error reason
    UBIFS: Add security.* XATTR support for the UBIFS
    UBIFS: Add xattr support for symlinks
    UBI: Block: Add blk-mq support
    UBI: Add initial support for scatter gather
    UBI: rename_volumes: Use UBI_METAONLY
    UBI: Implement UBI_METAONLY
    Add myself as UBI co-maintainer

    Linus Torvalds
     

28 Jan, 2015

1 commit

  • Artem: rename static functions so that they do not use the "ubifs_" prefix - we
    only use this prefix for non-static functions.
    Artem: remove few junk white-space changes in file.c

    Signed-off-by: Subodh Nijsure
    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Ben Shelton
    Acked-by: Brad Mouring
    Acked-by: Terry Wilcox
    Acked-by: Gratian Crisan
    Signed-off-by: Artem Bityutskiy

    Subodh Nijsure
     

21 Jan, 2015

1 commit

  • Now that we never use the backing_dev_info pointer in struct address_space
    we can simply remove it and save 4 to 8 bytes in every inode.

    Signed-off-by: Christoph Hellwig
    Acked-by: Ryusuke Konishi
    Reviewed-by: Tejun Heo
    Reviewed-by: Jan Kara
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

25 Oct, 2013

1 commit


29 Jun, 2013

3 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
    mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
    in the middle of 'ubifs_readdir()'.

    This means that 'file->private_data' can be freed while 'ubifs_readdir()' uses
    it, and this is a very bad bug: not only 'ubifs_readdir()' can return garbage,
    but this may corrupt memory and lead to all kinds of problems like crashes an
    security holes.

    This patch fixes the problem by using the 'file->f_version' field, which
    '->llseek()' always unconditionally sets to zero. We set it to 1 in
    'ubifs_readdir()' and whenever we detect that it became 0, we know there was a
    seek and it is time to clear the state saved in 'file->private_data'.

    I tested this patch by writing a user-space program which runds readdir and
    seek in parallell. I could easily crash the kernel without these patches, but
    could not crash it with these patches.

    Cc: stable@vger.kernel.org
    Reported-by: Al Viro
    Tested-by: Artem Bityutskiy
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Al Viro

    Artem Bityutskiy
     
  • Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
    mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
    in the middle of 'ubifs_readdir()'.

    First of all, this means that 'file->private_data' can be freed while
    'ubifs_readdir()' uses it. But this particular patch does not fix the problem.
    This patch is only a preparation, and the fix will follow next.

    In this patch we make 'ubifs_readdir()' stop using 'file->f_pos' directly,
    because 'file->f_pos' can be changed by '->llseek()' at any point. This may
    lead 'ubifs_readdir()' to returning inconsistent data: directory entry names
    may correspond to incorrect file positions.

    So here we introduce a local variable 'pos', read 'file->f_pose' once at very
    the beginning, and then stick to 'pos'. The result of this is that when
    'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of
    'ubifs_readdir()', the latter "wins".

    Cc: stable@vger.kernel.org
    Reported-by: Al Viro
    Tested-by: Artem Bityutskiy
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Al Viro

    Artem Bityutskiy
     

23 Feb, 2013

1 commit


18 Dec, 2012

1 commit


31 Aug, 2012

1 commit


24 Jul, 2012

1 commit

  • Pull UBIFS updates from Artem Bityutskiy:

    - Added another debugfs knob for forcing UBIFS R/O mode without
    flushing caches or finishing commit or any other I/O operation. I've
    originally added this knob in order to reproduce the free space fixup
    bug (see commit c6727932cfdb: "UBIFS: fix a bug in empty space
    fix-up") on nandsim.

    Without this knob I would have to do real power-cuts, which would
    make debugging much harder. Then I've decided to keep this knob
    because it is also useful for UBIFS power-cut recovery end
    error-paths testing.

    - Well-spotted fix from Julia. This bug did not cause real troubles
    for UBIFS, but nevertheless it could cause issues for someone trying
    to modify the orphans handling code. Kudos to coccinelle!

    - Minor cleanups.

    * tag 'upstream-3.6-rc1' of git://git.infradead.org/linux-ubifs:
    UBIFS: remove invalid reference to list iterator variable
    UBIFS: simplify reply code a bit
    UBIFS: add debugfs knob to switch to R/O mode
    UBIFS: fix compilation warning

    Linus Torvalds
     

20 Jul, 2012

1 commit

  • Fix the following compilation warning:

    fs/ubifs/dir.c: In function 'ubifs_rename':
    fs/ubifs/dir.c:972:15: warning: 'saved_nlink' may be used uninitialized
    in this function

    Use the 'uninitialized_var()' macro to get rid of this false-positive.

    Artem: massaged the patch a bit.

    Signed-off-by: Alexandre Pereira da Silva
    Signed-off-by: Artem Bityutskiy

    Alexandre Pereira da Silva
     

14 Jul, 2012

2 commits

  • boolean "does it have to be exclusive?" flag is passed instead;
    Local filesystem should just ignore it - the object is guaranteed
    not to be there yet.

    Signed-off-by: Al Viro

    Al Viro
     
  • Just the flags; only NFS cares even about that, but there are
    legitimate uses for such argument. And getting rid of that
    completely would require splitting ->lookup() into a couple
    of methods (at least), so let's leave that alone for now...

    Signed-off-by: Al Viro

    Al Viro
     

30 May, 2012

1 commit


17 May, 2012

1 commit


03 May, 2012

1 commit

  • Remove CONFIG_UBIFS_FS_XATTR configuration option and associated
    UBIFS_FS_XATTR ifdefs.

    Testing:
    Tested using integck while using nandsim on x86 & MX28 based
    platform with Micron MT29F2G08ABAEAH4 nand.

    Signed-off-by: Subodh Nijsure
    Signed-off-by: Artem Bityutskiy

    Subodh Nijsure
     

29 Feb, 2012

1 commit

  • This patch changes the 'i_nlink' counter handling in 'ubifs_unlink()',
    'ubifs_rmdir()' and 'ubifs_rename()'. In these function 'i_nlink' may become 0,
    and if 'ubifs_jnl_update()' failed, we would use 'inc_nlink()' to restore
    the previous 'i_nlink' value, which is incorrect from the VFS point of view and
    would cause a 'WARN_ON()' (see 'inc_nlink() implementation).

    This patches saves the previous 'i_nlink' value in a local variable and uses it
    at the error path instead of calling 'inc_nlink()'. We do this only for the
    inodes where 'i_nlink' may potentially become zero.

    This change has been requested by Al Viro .

    Signed-off-by: Artem Bityutskiy

    Artem Bityutskiy
     

04 Jan, 2012

4 commits


04 Jul, 2011

4 commits


28 May, 2011

1 commit


27 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (25 commits)
    cifs: remove unnecessary dentry_unhash on rmdir/rename_dir
    ocfs2: remove unnecessary dentry_unhash on rmdir/rename_dir
    exofs: remove unnecessary dentry_unhash on rmdir/rename_dir
    nfs: remove unnecessary dentry_unhash on rmdir/rename_dir
    ext2: remove unnecessary dentry_unhash on rmdir/rename_dir
    ext3: remove unnecessary dentry_unhash on rmdir/rename_dir
    ext4: remove unnecessary dentry_unhash on rmdir/rename_dir
    btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir
    ceph: remove unnecessary dentry_unhash calls
    vfs: clean up vfs_rename_other
    vfs: clean up vfs_rename_dir
    vfs: clean up vfs_rmdir
    vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems
    libfs: drop unneeded dentry_unhash
    vfs: update dentry_unhash() comment
    vfs: push dentry_unhash on rename_dir into file systems
    vfs: push dentry_unhash on rmdir into file systems
    vfs: remove dget() from dentry_unhash()
    vfs: dentry_unhash immediately prior to rmdir
    vfs: Block mmapped writes while the fs is frozen
    ...

    Linus Torvalds
     

26 May, 2011

2 commits