12 Oct, 2016

1 commit

  • The mapping_set_error() helper sets the correct AS_ flag for the mapping
    so there is no reason to open code it. Use the helper directly.

    [akpm@linux-foundation.org: be honest about conversion from -ENXIO to -EIO]
    Link: http://lkml.kernel.org/r/20160912111608.2588-2-mhocko@kernel.org
    Signed-off-by: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

11 Oct, 2016

4 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
     
  • Pull misc vfs updates from Al Viro:
    "Assorted misc bits and pieces.

    There are several single-topic branches left after this (rename2
    series from Miklos, current_time series from Deepa Dinamani, xattr
    series from Andreas, uaccess stuff from from me) and I'd prefer to
    send those separately"

    * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (39 commits)
    proc: switch auxv to use of __mem_open()
    hpfs: support FIEMAP
    cifs: get rid of unused arguments of CIFSSMBWrite()
    posix_acl: uapi header split
    posix_acl: xattr representation cleanups
    fs/aio.c: eliminate redundant loads in put_aio_ring_file
    fs/internal.h: add const to ns_dentry_operations declaration
    compat: remove compat_printk()
    fs/buffer.c: make __getblk_slow() static
    proc: unsigned file descriptors
    fs/file: more unsigned file descriptors
    fs: compat: remove redundant check of nr_segs
    cachefiles: Fix attempt to read i_blocks after deleting file [ver #2]
    cifs: don't use memcpy() to copy struct iov_iter
    get rid of separate multipage fault-in primitives
    fs: Avoid premature clearing of capabilities
    fs: Give dentry to inode_change_ok() instead of inode
    fuse: Propagate dentry down to inode_change_ok()
    ceph: Propagate dentry down to inode_change_ok()
    xfs: Propagate dentry down to inode_change_ok()
    ...

    Linus Torvalds
     

08 Oct, 2016

3 commits

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

07 Oct, 2016

1 commit

  • Pull f2fs updates from Jaegeuk Kim:
    "In this round, we've investigated how f2fs deals with errors given by
    our fault injection facility. With this, we could fix several corner
    cases. And, in order to improve the performance, we set inline_dentry
    by default and enhance the exisiting discard issue flow. In addition,
    we added f2fs_migrate_page for better memory management.

    Enhancements:
    - set inline_dentry by default
    - improve discard issue flow
    - add more fault injection cases in f2fs
    - allow block preallocation for encrypted files
    - introduce migrate_page callback function
    - avoid truncating the next direct node block at every checkpoint

    Bug fixes:
    - set page flag correctly between write_begin and write_end
    - missing error handling cases detected by fault injection
    - preallocate blocks regarding to 4KB alignement correctly
    - dentry and filename handling of encryption
    - lost xattrs of directories"

    * tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (69 commits)
    f2fs: introduce update_ckpt_flags to clean up
    f2fs: don't submit irrelevant page
    f2fs: fix to commit bio cache after flushing node pages
    f2fs: introduce get_checkpoint_version for cleanup
    f2fs: remove dead variable
    f2fs: remove redundant io plug
    f2fs: support checkpoint error injection
    f2fs: fix to recover old fault injection config in ->remount_fs
    f2fs: do fault injection initialization in default_options
    f2fs: remove redundant value definition
    f2fs: support configuring fault injection per superblock
    f2fs: adjust display format of segment bit
    f2fs: remove dirty inode pages in error path
    f2fs: do not unnecessarily null-terminate encrypted symlink data
    f2fs: handle errors during recover_orphan_inodes
    f2fs: avoid gc in cp_error case
    f2fs: should put_page for summary page
    f2fs: assign return value in f2fs_gc
    f2fs: add customized migrate_page callback
    f2fs: introduce cp_lock to protect updating of ckpt_flags
    ...

    Linus Torvalds
     

01 Oct, 2016

23 commits

  • This patch add update_ckpt_flags() to clean up the flow.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • While we call ->writepages, there are two cases:
    a. we didn't writeout any dirty pages, since they are writebacked by other
    thread concurrently.
    b. we writeout dirty pages, and have already submitted bio to block layer.

    In these cases, we don't need to do additional bio flushing unnecessarily,
    it may split bio in cache into smaller one.

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

    Chao Yu
     
  • In sync_node_pages, we won't check and commit last merged pages in private
    bio cache of f2fs, as these pages were taged as writeback, someone who is
    waiting for writebacking of the page will be blocked until the cache was
    committed by someone else.

    We need to commit node type bio cache to avoid potential deadlock or long
    delay of waiting writeback.

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

    Chao Yu
     
  • There exists almost same codes when get the value of pre_version
    and cur_version in function validate_checkpoint, this patch adds
    get_checkpoint_version to clean up redundant codes.

    Signed-off-by: Tiezhu Yang
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Tiezhu Yang
     
  • Signed-off-by: Sheng Yong
    Acked-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Sheng Yong
     
  • Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This patch adds to support checkpoint error injection in f2fs for testing
    fatal error tolerance, it will be useful that it can simulate abnormal
    power off by f2fs itself instead of calling godown ioctl by running apps.

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

    Chao Yu
     
  • In ->remount_fs, we didn't recover original fault injection config if
    we encounter error, fix it.

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

    Chao Yu
     
  • Do fault injection initialization in default_options to keep consistent
    with other default option configurating.

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

    Chao Yu
     
  • This patch remove redundant value definition in build_sit_entries

    Signed-off-by: Yunlei He
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Yunlei He
     
  • Previously, we only support global fault injection configuration, so that
    when we configure type/rate of fault injection through sysfs, mount
    option, it will influence all f2fs partition which is being used.

    It is not make sence, since it will be not convenient if developer want
    to test separated partitions with different fault injection rate/type
    simultaneously, also it's not possible to enable fault injection in one
    partition and disable fault injection in other one.

    >From now on, we move global configuration of fault injection in module
    into per-superblock, hence injection testing can be more flexible.

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

    Chao Yu
     
  • Just adjust segment bit info printed in procfs.

    Before:
    1008 5|0 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1009 3|183|0 0 61 20 20 0 0 21 80 c0 2 e4 e 54 0 21 21 17 a 44 d0 28 e4 50 40 30 8 0 2d 32 0 5 b0 80 1 43 2 8e f8 7b 2 25 93 bf e0 73 8e 9a 19 44 60 ff e4 cc e6 8e bf f9 ff 5 3d 31 3d 13
    1010 3|1 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    After:
    1008 5|0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    1009 4|434| ff 7d ff bf d9 3f ff e7 ff bf d7 bf ff bb be ff fb df f7 fb fa bf fb fe bb df dd ff fe ef ff fe ef e2 27 bf ab bf fb df fd bd bf fb db fc ff ff 3f ff ff bf ff 5f db 3f fb fb bf fb bf 4f ff ef
    1010 4|422| ff bb fe ff ef d7 ee ff ff fc bf ef 7d eb ec fd fb 3f 97 7f ef ff af ff db ff ff 69 bf ff f6 e7 ff fb f7 7b fb df be ff ff ef f3 fe ff ff df fe f7 fa ff b7 77 be fe fb a9 7f 87 a2 ac c7 ff 75

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

    Chao Yu
     
  • When getting EIO while handling orphan inodes, we can get some dirty node
    pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
    to flush node pages. But in this case, we should prevent to do that, since
    we will try again from the start.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • Null-terminating the fscrypt_symlink_data on read is unnecessary because
    it is not string data --- it contains binary ciphertext.

    Signed-off-by: Eric Biggers
    Signed-off-by: Jaegeuk Kim

    Eric Biggers
     
  • This patch fixes to handle EIO during recover_orphan_inode() given the below
    panic.

    F2FS-fs : inject IO error in f2fs_read_end_io+0xe6/0x100 [f2fs]
    ------------[ cut here ]------------
    RIP: 0010:[] [] f2fs_evict_inode+0x433/0x470 [f2fs]
    RSP: 0018:ffff92f8b7fb7c30 EFLAGS: 00010246
    RAX: ffff92fb88a13500 RBX: ffff92f890566ea0 RCX: 00000000fd3c255c
    RDX: 0000000000000001 RSI: ffff92fb88a13d90 RDI: ffff92fb8ee127e8
    RBP: ffff92f8b7fb7c58 R08: 0000000000000001 R09: ffff92fb88a13d58
    R10: 000000005a6a9373 R11: 0000000000000001 R12: 00000000fffffffb
    R13: ffff92fb8ee12000 R14: 00000000000034ca R15: ffff92fb8ee12620
    FS: 00007f1fefd8e880(0000) GS:ffff92fb95600000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007fc211d34cdb CR3: 000000012d43a000 CR4: 00000000001406e0
    Stack:
    ffff92f890566ea0 ffff92f890567078 ffffffffc0b5a0c0 ffff92f890566f28
    ffff92fb888b2000 ffff92f8b7fb7c80 ffffffffbc27ff55 ffff92f890566ea0
    ffff92fb8bf10000 ffffffffc0b5a0c0 ffff92f8b7fb7cb0 ffffffffbc28090d
    Call Trace:
    [] evict+0xc5/0x1a0
    [] iput+0x1ad/0x2c0
    [] recover_orphan_inodes+0x10c/0x2e0 [f2fs]
    [] f2fs_fill_super+0x884/0x1150 [f2fs]
    [] mount_bdev+0x18c/0x1c0
    [] ? f2fs_commit_super+0x100/0x100 [f2fs]
    [] f2fs_mount+0x15/0x20 [f2fs]
    [] mount_fs+0x39/0x170
    [] vfs_kern_mount+0x6b/0x160
    [] do_mount+0x1cf/0xd00
    [] ? copy_mount_options+0xac/0x170
    [] SyS_mount+0x83/0xd0
    [] entry_SYSCALL_64_fastpath+0x23/0xc1

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

    Jaegeuk Kim
     
  • Otherwise, we can hit
    f2fs_bug_on(sbi, !PageUptodate(sum_page));

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

    Jaegeuk Kim
     
  • We should call put_page for preloaded summary pages in do_garbage_collect.

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

    Jaegeuk Kim
     
  • This patch adds a return value of write_checkpoint for f2fs_gc.

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

    Jaegeuk Kim
     
  • This patch improves the migration of dirty pages and allows migrating atomic
    written pages that F2FS uses in Page Cache. Instead of the fallback releasing
    page path, it provides better performance for memory compaction, CMA and other
    users of memory page migrating. For dirty pages, there is no need to write back
    first when migrating. For an atomic written page before committing, we can
    migrate the page and update the related 'inmem_pages' list at the same time.

    Signed-off-by: Weichao Guo
    Reviewed-by: Chao Yu
    [Jaegeuk Kim: fix some coding style]
    Signed-off-by: Jaegeuk Kim

    Weichao Guo
     
  • This patch introduces spinlock to protect updating process of ckpt_flags
    field in struct f2fs_checkpoint, it avoids incorrectly updating in race
    condition.

    Signed-off-by: Chao Yu
    [Jaegeuk Kim: add __is_set_ckpt_flags likewise __set_ckpt_flags]
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Making updating of sbi flag atomic by using {test,set,clear}_bit,
    otherwise in concurrency scenario, the flag could be updated incorrectly.

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

    Chao Yu
     
  • Before checkpoint, we'd be better drop any inodes.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • Previously, we used cp_version only to detect recoverable dnodes.
    In order to avoid same garbage cp_version, we needed to truncate the next
    dnode during checkpoint, resulting in additional discard or data write.
    If we can distinguish this by using crc in addition to cp_version, we can
    remove this overhead.

    There is backward compatibility concern where it changes node_footer layout.
    So, this patch introduces a new checkpoint flag, CP_CRC_RECOVERY_FLAG, to
    detect new layout. New layout will be activated only when this flag is set.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

28 Sep, 2016

2 commits

  • current_fs_time() uses struct super_block* as an argument.
    As per Linus's suggestion, this is changed to take struct
    inode* as a parameter instead. This is because the function
    is primarily meant for vfs inode timestamps.
    Also the function was renamed as per Arnd's suggestion.

    Change all calls to current_fs_time() to use the new
    current_time() function instead. current_fs_time() will be
    deleted.

    Signed-off-by: Deepa Dinamani
    Signed-off-by: Al Viro

    Deepa Dinamani
     
  • 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


23 Sep, 2016

5 commits