11 Oct, 2016

3 commits

  • Pull more vfs updates from Al Viro:
    ">rename2() work from Miklos + current_time() from Deepa"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    fs: Replace current_fs_time() with current_time()
    fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
    fs: Replace CURRENT_TIME with current_time() for inode timestamps
    fs: proc: Delete inode time initializations in proc_alloc_inode()
    vfs: Add current_time() api
    vfs: add note about i_op->rename changes to porting
    fs: rename "rename2" i_op to "rename"
    vfs: remove unused i_op->rename
    fs: make remaining filesystems use .rename2
    libfs: support RENAME_NOREPLACE in simple_rename()
    fs: support RENAME_NOREPLACE for local filesystems
    ncpfs: fix unused variable warning

    Linus Torvalds
     
  • Al Viro
     
  • Pull vfs xattr updates from Al Viro:
    "xattr stuff from Andreas

    This completes the switch to xattr_handler ->get()/->set() from
    ->getxattr/->setxattr/->removexattr"

    * 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: Remove {get,set,remove}xattr inode operations
    xattr: Stop calling {get,set,remove}xattr inode operations
    vfs: Check for the IOP_XATTR flag in listxattr
    xattr: Add __vfs_{get,set,remove}xattr helpers
    libfs: Use IOP_XATTR flag for empty directory handling
    vfs: Use IOP_XATTR flag for bad-inode handling
    vfs: Add IOP_XATTR inode operations flag
    vfs: Move xattr_resolve_name to the front of fs/xattr.c
    ecryptfs: Switch to generic xattr handlers
    sockfs: Get rid of getxattr iop
    sockfs: getxattr: Fail with -EOPNOTSUPP for invalid attribute names
    kernfs: Switch to generic xattr handlers
    hfs: Switch to generic xattr handlers
    jffs2: Remove jffs2_{get,set,remove}xattr macros
    xattr: Remove unnecessary NULL attribute name check

    Linus Torvalds
     

08 Oct, 2016

2 commits

  • These inode operations are no longer used; remove them.

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Al Viro

    Andreas Gruenbacher
     
  • Pull ext4 updates from Ted Ts'o:
    "Lots of bug fixes and cleanups"

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (40 commits)
    ext4: remove unused variable
    ext4: use journal inode to determine journal overhead
    ext4: create function to read journal inode
    ext4: unmap metadata when zeroing blocks
    ext4: remove plugging from ext4_file_write_iter()
    ext4: allow unlocked direct IO when pages are cached
    ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY
    fscrypto: use standard macros to compute length of fname ciphertext
    ext4: do not unnecessarily null-terminate encrypted symlink data
    ext4: release bh in make_indexed_dir
    ext4: Allow parallel DIO reads
    ext4: allow DAX writeback for hole punch
    jbd2: fix lockdep annotation in add_transaction_credits()
    blockgroup_lock.h: simplify definition of NR_BG_LOCKS
    blockgroup_lock.h: remove debris from bgl_lock_ptr() conversion
    fscrypto: make filename crypto functions return 0 on success
    fscrypto: rename completion callbacks to reflect usage
    fscrypto: remove unnecessary includes
    fscrypto: improved validation when loading inode encryption metadata
    ext4: fix memory leak when symlink decryption fails
    ...

    Linus Torvalds
     

01 Oct, 2016

1 commit


28 Sep, 2016

1 commit

  • CURRENT_TIME macro is not appropriate for filesystems as it
    doesn't use the right granularity for filesystem timestamps.
    Use current_time() instead.

    CURRENT_TIME is also not y2038 safe.

    This is also in preparation for the patch that transitions
    vfs timestamps to use 64 bit time and hence make them
    y2038 safe. As part of the effort current_time() will be
    extended to do range checks. Hence, it is necessary for all
    file system timestamps to use current_time(). Also,
    current_time() will be transitioned along with vfs to be
    y2038 safe.

    Note that whenever a single call to current_time() is used
    to change timestamps in different inodes, it is because they
    share the same time granularity.

    Signed-off-by: Deepa Dinamani
    Reviewed-by: Arnd Bergmann
    Acked-by: Felipe Balbi
    Acked-by: Steven Whitehouse
    Acked-by: Ryusuke Konishi
    Acked-by: David Sterba
    Signed-off-by: Al Viro

    Deepa Dinamani
     

27 Sep, 2016

1 commit


16 Sep, 2016

1 commit

  • Several filename crypto functions: fname_decrypt(),
    fscrypt_fname_disk_to_usr(), and fscrypt_fname_usr_to_disk(), returned
    the output length on success or -errno on failure. However, the output
    length was redundant with the value written to 'oname->len'. It is also
    potentially error-prone to make callers have to check for '< 0' instead
    of '!= 0'.

    Therefore, make these functions return 0 instead of a length, and make
    the callers who cared about the return value being a length use
    'oname->len' instead. For consistency also make other callers check for
    a nonzero result rather than a negative result.

    This change also fixes the inconsistency of fname_encrypt() actually
    already returning 0 on success, not a length like the other filename
    crypto functions and as documented in its function comment.

    Signed-off-by: Eric Biggers
    Signed-off-by: Theodore Ts'o
    Reviewed-by: Andreas Dilger
    Acked-by: Jaegeuk Kim

    Eric Biggers
     

08 Sep, 2016

1 commit

  • Some applications may create multimeida file with temporary name like
    '*.jpg.tmp' or '*.mp4.tmp', then rename to '*.jpg' or '*.mp4'.

    Now, f2fs can only detect multimedia filename with specified format:
    "filename + '.' + extension", so it will make f2fs missing to detect
    multimedia file with special temporary name, result in failing to set
    cold flag on file.

    This patch enhances detection flow for enabling lookup extension in the
    middle of temporary filename.

    Reported-by: Xue Liu
    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     

21 Jul, 2016

1 commit


09 Jul, 2016

1 commit


07 Jul, 2016

2 commits


03 Jun, 2016

6 commits


03 May, 2016

1 commit


11 Apr, 2016

1 commit


05 Apr, 2016

2 commits

  • Pull f2fs fixes from Jaegeuk Kim.

    * tag 'f2fs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
    f2fs: retrieve IO write stat from the right place
    f2fs crypto: fix corrupted symlink in encrypted case
    f2fs: cover large section in sanity check of super

    Linus Torvalds
     
  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

31 Mar, 2016

1 commit


18 Mar, 2016

3 commits

  • During ->lookup, I_NEW state of inode was been cleared in f2fs_iget,
    so in error path, we don't need to clear it again.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This patch tries to catch up with lookup and open policies in ext4.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • This patch adds the renamed functions moved from the f2fs crypto files.

    1. definitions for per-file encryption used by ext4 and f2fs.

    2. crypto.c for encrypt/decrypt functions
    a. IO preparation:
    - fscrypt_get_ctx / fscrypt_release_ctx
    b. before IOs:
    - fscrypt_encrypt_page
    - fscrypt_decrypt_page
    - fscrypt_zeroout_range
    c. after IOs:
    - fscrypt_decrypt_bio_pages
    - fscrypt_pullback_bio_page
    - fscrypt_restore_control_page

    3. policy.c supporting context management.
    a. For ioctls:
    - fscrypt_process_policy
    - fscrypt_get_policy
    b. For context permission
    - fscrypt_has_permitted_context
    - fscrypt_inherit_context

    4. keyinfo.c to handle permissions
    - fscrypt_get_encryption_info
    - fscrypt_free_encryption_info

    5. fname.c to support filename encryption
    a. general wrapper functions
    - fscrypt_fname_disk_to_usr
    - fscrypt_fname_usr_to_disk
    - fscrypt_setup_filename
    - fscrypt_free_filename

    b. specific filename handling functions
    - fscrypt_fname_alloc_buffer
    - fscrypt_fname_free_buffer

    6. Makefile and Kconfig

    Cc: Al Viro
    Signed-off-by: Michael Halcrow
    Signed-off-by: Ildar Muslukhov
    Signed-off-by: Uday Savagaonkar
    Signed-off-by: Theodore Ts'o
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

03 Mar, 2016

1 commit

  • If f2fs was corrupted with missing dot dentries in root dirctory,
    it needs to recover them after fsck.f2fs set F2FS_INLINE_DOTS flag
    in directory inode when fsck.f2fs detects missing dot dentries.

    Signed-off-by: Xue Liu
    Signed-off-by: Yong Sheng
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Liu Xue
     

23 Feb, 2016

3 commits

  • When doing test with fstests/generic/068 in inline_dentry enabled f2fs,
    following oops dmesg will be reported:

    ------------[ cut here ]------------
    WARNING: CPU: 5 PID: 11841 at fs/inode.c:273 drop_nlink+0x49/0x50()
    Modules linked in: f2fs(O) ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
    CPU: 5 PID: 11841 Comm: fsstress Tainted: G O 4.5.0-rc1 #45
    Hardware name: Hewlett-Packard HP Z220 CMT Workstation/1790, BIOS K51 v01.61 05/16/2013
    0000000000000111 ffff88009cdf7ae8 ffffffff813e5944 0000000000002e41
    0000000000000000 0000000000000111 0000000000000000 ffff88009cdf7b28
    ffffffff8106a587 ffff88009cdf7b58 ffff8804078fe180 ffff880374a64e00
    Call Trace:
    [] dump_stack+0x48/0x64
    [] warn_slowpath_common+0x97/0xe0
    [] warn_slowpath_null+0x1a/0x20
    [] drop_nlink+0x49/0x50
    [] f2fs_rename2+0xe04/0x10c0 [f2fs]
    [] ? lock_two_nondirectories+0x81/0x90
    [] ? lockref_get+0x1d/0x30
    [] vfs_rename+0x2e0/0x640
    [] ? lookup_dcache+0x3b/0xd0
    [] ? update_fast_ctr+0x21/0x40
    [] ? security_path_rename+0xa2/0xd0
    [] SYSC_renameat2+0x4b6/0x540
    [] ? trace_hardirqs_off+0xd/0x10
    [] ? exit_to_usermode_loop+0x7a/0xd0
    [] ? int_ret_from_sys_call+0x52/0x9f
    [] ? trace_hardirqs_on_caller+0x100/0x1c0
    [] SyS_renameat2+0xe/0x10
    [] SyS_rename+0x1e/0x20
    [] entry_SYSCALL_64_fastpath+0x12/0x6f
    ---[ end trace 2b31e17995404e42 ]---

    This is because: in the same inline directory, when we renaming one file
    from source name to target name which is not existed, once space of inline
    dentry is not enough, inline conversion will be triggered, after that all
    data in inline dentry will be moved to normal dentry page.

    After attaching the new entry in coverted dentry page, still we try to
    remove old entry in original inline dentry, since old entry has been
    moved, so it obviously doesn't make any effect, result in remaining old
    entry in converted dentry page.

    Now, we have two valid dentries pointed to the same inode which has nlink
    value of 1, deleting them both, above warning appears.

    This issue can be reproduced easily as below steps:
    1. mount f2fs with inline_dentry option
    2. mkdir dir
    3. touch 180 files named [001-180] in dir
    4. rename dir/180 dir/181
    5. rm dir/180 dir/181

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Should check and show correct return value of update_dent_inode in
    ->rename.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This patch adopts f2fs with codes of ext4, it removes unneeded memory
    allocation in creating/accessing path of symlink.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     

14 Jan, 2016

1 commit

  • Pull f2fs updates from Jaegeuk Kim:
    "This series adds two ioctls to control cached data and fragmented
    files. Most of the rest fixes missing error cases and bugs that we
    have not covered so far. Summary:

    Enhancements:
    - support an ioctl to execute online file defragmentation
    - support an ioctl to flush cached data
    - speed up shrinking of extent_cache entries
    - handle broken superblock
    - refector dirty inode management infra
    - revisit f2fs_map_blocks to handle more cases
    - reduce global lock coverage
    - add detecting user's idle time

    Major bug fixes:
    - fix data race condition on cached nat entries
    - fix error cases of volatile and atomic writes"

    * tag 'for-f2fs-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (87 commits)
    f2fs: should unset atomic flag after successful commit
    f2fs: fix wrong memory condition check
    f2fs: monitor the number of background checkpoint
    f2fs: detect idle time depending on user behavior
    f2fs: introduce time and interval facility
    f2fs: skip releasing nodes in chindless extent tree
    f2fs: use atomic type for node count in extent tree
    f2fs: recognize encrypted data in f2fs_fiemap
    f2fs: clean up f2fs_balance_fs
    f2fs: remove redundant calls
    f2fs: avoid unnecessary f2fs_balance_fs calls
    f2fs: check the page status filled from disk
    f2fs: introduce __get_node_page to reuse common code
    f2fs: check node id earily when readaheading node page
    f2fs: read isize while holding i_mutex in fiemap
    Revert "f2fs: check the node block address of newly allocated nid"
    f2fs: cover more area with nat_tree_lock
    f2fs: introduce max_file_blocks in sbi
    f2fs crypto: check CONFIG_F2FS_FS_XATTR for encrypted symlink
    f2fs: introduce zombie list for fast shrinking extent trees
    ...

    Linus Torvalds
     

09 Jan, 2016

1 commit


01 Jan, 2016

1 commit


31 Dec, 2015

5 commits