11 Feb, 2020

1 commit

  • commit d9e9866803f7b6c3fdd35d345e97fb0b2908bbbc upstream.

    Clang warns:

    ../fs/ext2/super.c:1076:3: warning: misleading indentation; statement is
    not part of the previous 'if' [-Wmisleading-indentation]
    sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) -
    ^
    ../fs/ext2/super.c:1074:2: note: previous statement is here
    if (EXT2_BLOCKS_PER_GROUP(sb) == 0)
    ^
    1 warning generated.

    This warning occurs because there is a space before the tab on this
    line. Remove it so that the indentation is consistent with the Linux
    kernel coding style and clang no longer warns.

    Fixes: 41f04d852e35 ("[PATCH] ext2: fix mounts at 16T")
    Link: https://github.com/ClangBuiltLinux/linux/issues/827
    Link: https://lore.kernel.org/r/20191218031930.31393-1-natechancellor@gmail.com
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Nathan Chancellor
     

18 Dec, 2019

1 commit

  • commit e705f4b8aa27a59f8933e8f384e9752f052c469c upstream.

    Check err when partial == NULL is meaningless because
    partial == NULL means getting branch successfully without
    error.

    CC: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191105045100.7104-1-cgxu519@mykernel.net
    Signed-off-by: Chengguang Xu
    Signed-off-by: Jan Kara
    Signed-off-by: Greg Kroah-Hartman

    Chengguang Xu
     

22 Sep, 2019

1 commit

  • Pull ext2, quota, udf fixes and cleanups from Jan Kara:

    - two small quota fixes (in grace time handling and possible missed
    accounting of preallocated blocks beyond EOF).

    - some ext2 cleanups

    - udf fixes for better compatibility with Windows 10 generated media
    (named streams, write-protection using domain-identifier, placement
    of volume recognition sequence)

    - some udf cleanups

    * tag 'for_v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    quota: fix wrong condition in is_quota_modification()
    fs-udf: Delete an unnecessary check before brelse()
    ext2: Delete an unnecessary check before brelse()
    udf: Drop forward function declarations
    udf: Verify domain identifier fields
    udf: augment UDF permissions on new inodes
    udf: Use dynamic debug infrastructure
    udf: reduce leakage of blocks related to named streams
    udf: prevent allocation beyond UDF partition
    quota: fix condition for resetting time limit in do_set_dqblk()
    ext2: code cleanup for ext2_free_blocks()
    ext2: fix block range in ext2_data_block_valid()
    udf: support 2048-byte spacing of VRS descriptors on 4K media
    udf: refactor VRS descriptor identification

    Linus Torvalds
     

05 Sep, 2019

1 commit

  • The brelse() function tests whether its argument is NULL
    and then returns immediately.
    Thus the test around the call is not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Link: https://lore.kernel.org/r/51dea296-2207-ebc0-bac3-13f3e5c3b235@web.de
    Signed-off-by: Jan Kara

    Markus Elfring
     

30 Aug, 2019

1 commit

  • Fill in the appropriate limits to avoid inconsistencies
    in the vfs cached inode times when timestamps are
    outside the permitted range.

    Even though some filesystems are read-only, fill in the
    timestamps to reflect the on-disk representation.

    Signed-off-by: Deepa Dinamani
    Reviewed-by: Darrick J. Wong
    Acked-By: Tigran Aivazian
    Acked-by: Jeff Layton
    Cc: aivazian.tigran@gmail.com
    Cc: al@alarsen.net
    Cc: coda@cs.cmu.edu
    Cc: darrick.wong@oracle.com
    Cc: dushistov@mail.ru
    Cc: dwmw2@infradead.org
    Cc: hch@infradead.org
    Cc: jack@suse.com
    Cc: jaharkes@cs.cmu.edu
    Cc: luisbg@kernel.org
    Cc: nico@fluxnic.net
    Cc: phillip@squashfs.org.uk
    Cc: richard@nod.at
    Cc: salah.triki@gmail.com
    Cc: shaggy@kernel.org
    Cc: linux-xfs@vger.kernel.org
    Cc: codalist@coda.cs.cmu.edu
    Cc: linux-ext4@vger.kernel.org
    Cc: linux-mtd@lists.infradead.org
    Cc: jfs-discussion@lists.sourceforge.net
    Cc: reiserfs-devel@vger.kernel.org

    Deepa Dinamani
     

31 Jul, 2019

2 commits


13 Jul, 2019

1 commit

  • Pull common SETFLAGS/FSSETXATTR parameter checking from Darrick Wong:
    "Here's a patch series that sets up common parameter checking functions
    for the FS_IOC_SETFLAGS and FS_IOC_FSSETXATTR ioctl implementations.

    The goal here is to reduce the amount of behaviorial variance between
    the filesystems where those ioctls originated (ext2 and XFS,
    respectively) and everybody else.

    - Standardize parameter checking for the SETFLAGS and FSSETXATTR
    ioctls (which were the file attribute setters for ext4 and xfs and
    have now been hoisted to the vfs)

    - Only allow the DAX flag to be set on files and directories"

    * tag 'vfs-fix-ioctl-checking-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
    vfs: only allow FSSETXATTR to set DAX flag on files and dirs
    vfs: teach vfs_ioc_fssetxattr_check to check extent size hints
    vfs: teach vfs_ioc_fssetxattr_check to check project id info
    vfs: create a generic checking function for FS_IOC_FSSETXATTR
    vfs: create a generic checking and prep function for FS_IOC_SETFLAGS

    Linus Torvalds
     

11 Jul, 2019

1 commit

  • Pull ext2, udf and quota updates from Jan Kara:

    - some ext2 fixes and cleanups

    - a fix of udf bug when extending files

    - a fix of quota Q_XGETQSTAT[V] handling

    * tag 'for_v5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
    ext2: Use kmemdup rather than duplicating its implementation
    quota: honor quota type in Q_XGETQSTAT[V] calls
    ext2: Always brelse bh on failure in ext2_iget()
    ext2: add missing brelse() in ext2_iget()
    ext2: Fix a typo in ext2_getattr argument
    ext2: fix a typo in comment
    ext2: add missing brelse() in ext2_new_inode()
    ext2: optimize ext2_xattr_get()
    ext2: introduce new helper for xattr entry comparison
    ext2: merge xattr next entry check to ext2_xattr_entry_valid()
    ext2: code cleanup for ext2_preread_inode()
    ext2: code cleanup by using test_opt() and clear_opt()
    doc: ext2: update description of quota options for ext2
    ext2: Strengthen xattr block checks
    ext2: Merge loops in ext2_xattr_set()
    ext2: introduce helper for xattr entry validation
    ext2: introduce helper for xattr header validation
    quota: add dqi_dirty_list description to comment of Dquot List Management

    Linus Torvalds
     

03 Jul, 2019

1 commit

  • kmemdup is introduced to duplicate a region of memory in a neat way.
    Rather than kmalloc/kzalloc + memset, which the programmer needs to
    write the size twice (sometimes lead to mistakes), kmemdup improves
    readability, leads to smaller code and also reduce the chances of mistakes.
    Suggestion to use kmemdup rather than using kmalloc/kzalloc + memset.

    Signed-off-by: Fuqian Huang
    Link: https://lore.kernel.org/r/20190703131727.25735-1-huangfq.daxian@gmail.com
    Signed-off-by: Jan Kara

    Fuqian Huang
     

01 Jul, 2019

1 commit

  • Create a generic function to check incoming FS_IOC_SETFLAGS flag values
    and later prepare the inode for updates so that we can standardize the
    implementations that follow ext4's flag values.

    Note that the efivarfs implementation no longer fails a no-op SETFLAGS
    without CAP_LINUX_IMMUTABLE since that's the behavior in ext*.

    Signed-off-by: Darrick J. Wong
    Reviewed-by: Jan Kara
    Reviewed-by: Christoph Hellwig
    Acked-by: David Sterba
    Reviewed-by: Bob Peterson

    Darrick J. Wong
     

20 Jun, 2019

2 commits


12 Jun, 2019

2 commits


30 May, 2019

1 commit


28 May, 2019

4 commits


21 May, 2019

2 commits


20 May, 2019

5 commits


14 May, 2019

1 commit

  • Pull misc filesystem updates from Jan Kara:
    "A couple of small bugfixes and cleanups for quota, udf, ext2, and
    reiserfs"

    * tag 'fs_for_v5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    quota: check time limit when back out space/inode change
    fs/quota: erase unused but set variable warning
    quota: fix wrong indentation
    udf: fix an uninitialized read bug and remove dead code
    fs/reiserfs/journal.c: Make remove_journal_hash static
    quota: remove trailing whitespaces
    quota: code cleanup for __dquot_alloc_space()
    ext2: Adjust the comment of function ext2_alloc_branch
    udf: Explain handling of load_nls() failure

    Linus Torvalds
     

02 May, 2019

1 commit


26 Mar, 2019

1 commit


08 Mar, 2019

1 commit

  • Pull ext2 and udf fixes from Jan Kara:
    "A couple of fixes for udf and ext2. Namely:

    - fix making ext2 mountable (again) with 64k blocksize

    - fix for ext2 statx(2) handling

    - fix for udf handling of corrupted filesystem so that it doesn't get
    corrupted even further

    - couple smaller ext2 and udf cleanups"

    * tag 'fs_for_v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Drop pointless check from udf_sync_fs()
    ext2: support statx syscall
    udf: disallow RW mount without valid integrity descriptor
    udf: finalize integrity descriptor before writeback
    udf: factor out LVID finalization for reuse
    ext2: Fix underflow in ext2_max_size()
    ext2: Fix a typo in comment
    ext2: Remove redundant check for finding no group
    ext2: Annotate implicit fall through in __ext2_truncate_blocks
    ext2: Set superblock revision when enabling xattr feature
    ext2: Remove redundant check on s_inode_size
    ext2: set proper return code

    Linus Torvalds
     

18 Feb, 2019

1 commit

  • Since statx, every filesystem should fill the attributes/attributes_mask
    in routine getattr. But the generic_fillattr has not fill that, so add
    ext2_getattr to do this. This can fix generic/424 while testing ext2.

    Reviewed-by: zhangyi (F)
    Signed-off-by: yangerkun
    Signed-off-by: Jan Kara

    yangerkun
     

31 Jan, 2019

1 commit

  • When ext2 filesystem is created with 64k block size, ext2_max_size()
    will return value less than 0. Also, we cannot write any file in this fs
    since the sb->maxbytes is less than 0. The core of the problem is that
    the size of block index tree for such large block size is more than
    i_blocks can carry. So fix the computation to count with this
    possibility.

    File size limits computed with the new function for the full range of
    possible block sizes look like:

    bits file_size
    10 17247252480
    11 275415851008
    12 2196873666560
    13 2197948973056
    14 2198486220800
    15 2198754754560
    16 2198888906752

    CC: stable@vger.kernel.org
    Reported-by: yangerkun
    Signed-off-by: Jan Kara

    Jan Kara
     

29 Jan, 2019

1 commit


28 Jan, 2019

2 commits


22 Jan, 2019

4 commits

  • When setting the first xattr, we automatically enable
    EXT2_FEATURE_COMPAT_EXT_ATTR. However we forget to call
    ext2_update_dynamic_rev() so in theory if the filesystem was created as
    ancient one without features support, this could be missed. The
    consequences are minor anyway - since the feature is compat one, only
    old e2fsck which does not understand xattrs could do something bad.

    Reported-by: Andreas Dilger
    Signed-off-by: Jan Kara

    Jan Kara
     
  • The case of (EXT2_INODE_SIZE(sb) == 0) is included in
    (sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE).
    So there is no need to check again.

    Signed-off-by: Liu Xiang
    Signed-off-by: Jan Kara

    Liu Xiang
     
  • Set proper return code when failing from allocating
    memory in ext2_fill_super().

    Signed-off-by: Chengguang Xu
    Signed-off-by: Jan Kara

    Chengguang Xu
     
  • Deduplicate the ext2 file type conversion implementation and remove
    EXT2_FT_* definitions - file systems that use the same file types as
    defined by POSIX do not need to define their own versions and can
    use the common helper functions decared in fs_types.h and implemented
    in fs_types.c

    Signed-off-by: Amir Goldstein
    Signed-off-by: Phillip Potter
    Signed-off-by: Jan Kara

    Phillip Potter