1. 25 7月, 2015 2 次提交
    • J
      f2fs: call set_page_dirty to attach i_wb for cgroup · 6282adbf
      Jaegeuk Kim 提交于
      The cgroup attaches inode->i_wb via mark_inode_dirty and when set_page_writeback
      is called, __inc_wb_stat() updates i_wb's stat.
      
      So, we need to explicitly call set_page_dirty->__mark_inode_dirty in prior to
      any writebacking pages.
      
      This patch should resolve the following kernel panic reported by Andreas Reis.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=101801
      
      --- Comment #2 from Andreas Reis <andreas.reis@gmail.com> ---
      BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
      IP: [<ffffffff8149deea>] __percpu_counter_add+0x1a/0x90
      PGD 2951ff067 PUD 2df43f067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 7 PID: 10356 Comm: gcc Tainted: G        W       4.2.0-1-cu #1
      Hardware name: Gigabyte Technology Co., Ltd. G1.Sniper M5/G1.Sniper M5, BIOS
      T01 02/03/2015
      task: ffff880295044f80 ti: ffff880295140000 task.ti: ffff880295140000
      RIP: 0010:[<ffffffff8149deea>]  [<ffffffff8149deea>]
      __percpu_counter_add+0x1a/0x90
      RSP: 0018:ffff880295143ac8  EFLAGS: 00010082
      RAX: 0000000000000003 RBX: ffffea000a526d40 RCX: 0000000000000001
      RDX: 0000000000000020 RSI: 0000000000000001 RDI: 0000000000000088
      RBP: ffff880295143ae8 R08: 0000000000000000 R09: ffff88008f69bb30
      R10: 00000000fffffffa R11: 0000000000000000 R12: 0000000000000088
      R13: 0000000000000001 R14: ffff88041d099000 R15: ffff880084a205d0
      FS:  00007f8549374700(0000) GS:ffff88042f3c0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000000000a8 CR3: 000000033e1d5000 CR4: 00000000001406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Stack:
       0000000000000000 ffffea000a526d40 ffff880084a20738 ffff880084a20750
       ffff880295143b48 ffffffff811cc91e ffff880000000000 0000000000000296
       0000000000000000 ffff880417090198 0000000000000000 ffffea000a526d40
      Call Trace:
       [<ffffffff811cc91e>] __test_set_page_writeback+0xde/0x1d0
       [<ffffffff813fee87>] do_write_data_page+0xe7/0x3a0
       [<ffffffff813faeea>] gc_data_segment+0x5aa/0x640
       [<ffffffff813fb0b8>] do_garbage_collect+0x138/0x150
       [<ffffffff813fb3fe>] f2fs_gc+0x1be/0x3e0
       [<ffffffff81405541>] f2fs_balance_fs+0x81/0x90
       [<ffffffff813ee357>] f2fs_unlink+0x47/0x1d0
       [<ffffffff81239329>] vfs_unlink+0x109/0x1b0
       [<ffffffff8123e3d7>] do_unlinkat+0x287/0x2c0
       [<ffffffff8123ebc6>] SyS_unlink+0x16/0x20
       [<ffffffff81942e2e>] entry_SYSCALL_64_fastpath+0x12/0x71
      Code: 41 5e 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 55 49
      89 f5 41 54 49 89 fc 53 48 83 ec 08 65 ff 05 e6 d9 b6 7e <48> 8b 47 20 48 63 ca
      65 8b 18 48 63 db 48 01 f3 48 39 cb 7d 0a
      RIP  [<ffffffff8149deea>] __percpu_counter_add+0x1a/0x90
       RSP <ffff880295143ac8>
      CR2: 00000000000000a8
      ---[ end trace 5132449a58ed93a3 ]---
      note: gcc[10356] exited with preempt_count 2
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6282adbf
    • J
      f2fs: handle error cases in move_encrypted_block · 548aedac
      Jaegeuk Kim 提交于
      This patch fixes some missing error handlers.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      548aedac
  2. 12 6月, 2015 3 次提交
  3. 10 6月, 2015 1 次提交
  4. 09 6月, 2015 2 次提交
  5. 03 6月, 2015 3 次提交
    • J
      f2fs: fix to return exact trimmed size · f56aa1c5
      Jaegeuk Kim 提交于
      Now, we add all the candidates for trim commands and then finally issue
      discard commands.
      So, we should count the trimmed size in back-end.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f56aa1c5
    • C
      f2fs: support FALLOC_FL_INSERT_RANGE · f62185d0
      Chao Yu 提交于
      FALLOC_FL_INSERT_RANGE flag for ->fallocate was introduced in commit
      dd46c787 ("fs: Add support FALLOC_FL_INSERT_RANGE for fallocate").
      
      The effect of FALLOC_FL_INSERT_RANGE command is the opposite of
      FALLOC_FL_COLLAPSE_RANGE, if this command was performed, all data from
      offset to EOF in our file will be shifted to right as given length, and
      then range [offset, offset + length] becomes a hole.
      
      This command is useful for our user who wants to add some data in the
      middle of the file, for example: video/music editor will insert a keyframe
      in specified position of media file, with this command we can easily create
      a hole for inserting without removing original data.
      
      This patch introduces f2fs_insert_range() to support FALLOC_FL_INSERT_RANGE.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NYuan Zhong <yuan.mark.zhong@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f62185d0
    • C
      f2fs: hide common code in f2fs_replace_block · 528e3459
      Chao Yu 提交于
      This patch clean up codes through:
      1.rename f2fs_replace_block to __f2fs_replace_block().
      2.introduce new f2fs_replace_block() to include __f2fs_replace_block()
      and some common related codes around __f2fs_replace_block().
      
      Then, newly introduced function f2fs_replace_block can be used by
      following patch.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      528e3459
  6. 02 6月, 2015 29 次提交
    • T
      writeback: separate out include/linux/backing-dev-defs.h · 66114cad
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      66114cad
    • T
      writeback: move bandwidth related fields from backing_dev_info into bdi_writeback · a88a341a
      Tejun Heo 提交于
      Currently, a bdi (backing_dev_info) embeds single wb (bdi_writeback)
      and the role of the separation is unclear.  For cgroup support for
      writeback IOs, a bdi will be updated to host multiple wb's where each
      wb serves writeback IOs of a different cgroup on the bdi.  To achieve
      that, a wb should carry all states necessary for servicing writeback
      IOs for a cgroup independently.
      
      This patch moves bandwidth related fields from backing_dev_info into
      bdi_writeback.
      
      * The moved fields are: bw_time_stamp, dirtied_stamp, written_stamp,
        write_bandwidth, avg_write_bandwidth, dirty_ratelimit,
        balanced_dirty_ratelimit, completions and dirty_exceeded.
      
      * writeback_chunk_size() and over_bground_thresh() now take @wb
        instead of @bdi.
      
      * bdi_writeout_fraction(bdi, ...)	-> wb_writeout_fraction(wb, ...)
        bdi_dirty_limit(bdi, ...)		-> wb_dirty_limit(wb, ...)
        bdi_position_ration(bdi, ...)		-> wb_position_ratio(wb, ...)
        bdi_update_writebandwidth(bdi, ...)	-> wb_update_write_bandwidth(wb, ...)
        [__]bdi_update_bandwidth(bdi, ...)	-> [__]wb_update_bandwidth(wb, ...)
        bdi_{max|min}_pause(bdi, ...)		-> wb_{max|min}_pause(wb, ...)
        bdi_dirty_limits(bdi, ...)		-> wb_dirty_limits(wb, ...)
      
      * Init/exits of the relocated fields are moved to bdi_wb_init/exit()
        respectively.  Note that explicit zeroing is dropped in the process
        as wb's are cleared in entirety anyway.
      
      * As there's still only one bdi_writeback per backing_dev_info, all
        uses of bdi->stat[] are mechanically replaced with bdi->wb.stat[]
        introducing no behavior changes.
      
      v2: Typo in description fixed as suggested by Jan.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a88a341a
    • C
      f2fs: disable the discard option when device doesn't support · 96c6dd59
      Chenxi Mao 提交于
      Current f2fs check the whether the blk device can support discard.
      However, the code will cause the discard option cannot be enabled.
      Because the clear_opt(sbi, DISCARD) will be invoked forever.
      
      This patch can fix this issue.
      
      Jaegeuk Kim:
       The original patch was intended to disable the discard option when device
       does not support trim command.
       Rather than remaining the buggy patch, let's replace with this patch as
       an integrated one.
      Signed-off-by: NChenxi Mao <chenxi.mao2013@gmail.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      96c6dd59
    • J
      f2fs crypto: remove alloc_page for bounce_page · 4683ff83
      Jaegeuk Kim 提交于
      We don't need to call alloc_page() prior to mempool_alloc(), since the
      mempool_alloc() calls alloc_page() internally.
      And, if __GFP_WAIT is set, it never fails on page allocation, so let's
      give GFP_NOWAIT and handle ENOMEM by writepage().
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      4683ff83
    • J
      f2fs: fix a deadlock for summary page lock vs. sentry_lock · 9236cac5
      Jaegeuk Kim 提交于
      In f2fs_gc:                      In f2fs_replace_block:
       - lock_page(sum_page)
        - check_valid_map()            - mutex_lock(sentry_lock)
         - mutex_lock(sentry_lock)     - change_curseg()
                                        - lock_page(sum_page)
      
      This patch fixes the deadlock condition.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      9236cac5
    • J
      f2fs crypto: clean up error handling in f2fs_fname_setup_filename · e5e0906b
      Jaegeuk Kim 提交于
      Sync with:
        ext4 crypto: clean up error handling in ext4_fname_setup_filename
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e5e0906b
    • J
      f2fs crypto: avoid f2fs_inherit_context for symlink · e992e238
      Jaegeuk Kim 提交于
      This patch fixes to call f2fs_inherit_context twice for newly created symlink.
      The original one is called by f2fs_add_link(), which invokes f2fs_setxattr.
      If the second one is called again, f2fs_setxattr is triggered again with same
      encryption index.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e992e238
    • C
      f2fs crypto: do not set encryption policy for non-directory by ioctl · 4637fd11
      Chao Yu 提交于
      Encryption policy should only be set to an empty directory through ioctl,
      This patch add a judgement condition to verify type of the target inode
      to avoid incorrectly configuring for non-directory.
      
      Additionally, remove unneeded inline data conversion since regular or symlink
      file should not be processed here.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      4637fd11
    • C
      f2fs crypto: allow setting encryption policy once · 81b0a8ff
      Chao Yu 提交于
      This patch add XATTR_CREATE flag in setxattr when setting encryption
      context for inode. Without this flag the context could be set more than
      once, this should never happen. So, fix it.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      81b0a8ff
    • C
      f2fs crypto: check context consistent for rename2 · d3baf7c4
      Chao Yu 提交于
      For exchange rename, we should check context consistent of encryption
      between new_dir and old_inode or old_dir and new_inode. Otherwise
      inheritance of parent's encryption context will be broken.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      [Jaegeuk Kim: sync with ext4 approach]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d3baf7c4
    • C
      f2fs: avoid duplicated code by reusing f2fs_read_end_io · 12377024
      Chao Yu 提交于
      This patch tries to clean up code because part code of f2fs_read_end_io
      and mpage_end_io are the same, so it's better to merge and reuse them.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      12377024
    • J
      f2fs crypto: use per-inode tfm structure · 26bf3dc7
      Jaegeuk Kim 提交于
      This patch applies the following ext4 patch:
      
        ext4 crypto: use per-inode tfm structure
      
      As suggested by Herbert Xu, we shouldn't allocate a new tfm each time
      we read or write a page.  Instead we can use a single tfm hanging off
      the inode's crypt_info structure for all of our encryption needs for
      that inode, since the tfm can be used by multiple crypto requests in
      parallel.
      
      Also use cmpxchg() to avoid races that could result in crypt_info
      structure getting doubly allocated or doubly freed.
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      26bf3dc7
    • H
      f2fs: recovering broken superblock during mount · da554e48
      hujianyang 提交于
      This patch recovers a broken superblock with the other valid one.
      Signed-off-by: Nhujianyang <hujianyang@huawei.com>
      [Jaegeuk Kim: reinitialize local variables in f2fs_fill_super for retrial]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      da554e48
    • J
      f2fs crypto: check encryption for tmpfile · 304eecc3
      Jaegeuk Kim 提交于
      This patch adds to check encryption for tmpfile in early stage.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      304eecc3
    • C
      f2fs: support RENAME_WHITEOUT · 7e01e7ad
      Chao Yu 提交于
      As the description of rename in manual, RENAME_WHITEOUT is a special operation
      that only makes sense for overlay/union type filesystem.
      
      When performing rename with RENAME_WHITEOUT, dst will be replace with src, and
      meanwhile, a 'whiteout' will be create with name of src.
      
      A "whiteout" is designed to be a char device with 0,0 device number, it has
      specially meaning for stackable filesystem. In these filesystems, there are
      multiple layers exist, and only top of these can be modified. So a whiteout
      in top layer is used to hide a corresponding file in lower layer, as well
      removal of whiteout will make the file appear.
      
      Now in overlayfs, when we rename a file which is exist in lower layer, it
      will be copied up to upper if it is not on upper layer yet, and then rename
      it on upper layer, source file will be whiteouted to hide corresponding file
      in lower layer at the same time.
      
      So in upper layer filesystem, implementation of RENAME_WHITEOUT provide a
      atomic operation for stackable filesystem to support rename operation.
      
      There are multiple ways to implement RENAME_WHITEOUT in log of this commit:
      7dcf5c3e ("xfs: add RENAME_WHITEOUT support") which pointed out by
      Dave Chinner.
      
      For now, we just try to follow the way that xfs/ext4 use.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7e01e7ad
    • C
      f2fs: introduce update_meta_page · 381722d2
      Chao Yu 提交于
      Add a help function update_meta_page() to update meta page with specified
      buffer.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      381722d2
    • C
      f2fs crypto: zero next free dnode block · cb5c94cf
      Chao Yu 提交于
      Now page cache of meta inode is used by garbage collection for encrypted page,
      it may contain random data, so we should zero it before issuing discard.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      cb5c94cf
    • J
      f2fs crypto: split f2fs_crypto_init/exit with two parts · cfc4d971
      Jaegeuk Kim 提交于
      This patch splits f2fs_crypto_init/exit with two parts: base initialization and
      memory allocation.
      
      Firstly, f2fs module declares the base encryption memory pointers.
      Then, allocating internal memories is done at the first encrypted inode access.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      cfc4d971
    • C
      f2fs crypto: fix incorrect release for crypto ctx · b9da898b
      Chao Yu 提交于
      When encryption feature is enable, if we rmmod f2fs module,
      we will encounter a stack backtrace reported in syslog:
      
      "BUG: Bad page state in process rmmod  pfn:aaf8a
      page:f0f4f148 count:0 mapcount:129 mapping:ee2f4104 index:0x80
      flags: 0xee2830a4(referenced|lru|slab|private_2|writeback|swapbacked|mlocked)
      page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
      bad because of flags:
      flags: 0x2030a0(lru|slab|private_2|writeback|mlocked)
      Modules linked in: f2fs(O-) fuse bnep rfcomm bluetooth dm_crypt binfmt_misc snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm
      snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device joydev ppdev mac_hid lp hid_generic i2c_piix4
      parport_pc psmouse snd serio_raw parport soundcore ext4 jbd2 mbcache usbhid hid e1000 [last unloaded: f2fs]
      CPU: 1 PID: 3049 Comm: rmmod Tainted: G    B      O    4.1.0-rc3+ #10
      Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      00000000 00000000 c0021eb4 c15b7518 f0f4f148 c0021ed8 c112e0b7 c1779174
      c9b75674 000aaf8a 01b13ce1 c17791a4 f0f4f148 ee2830a4 c0021ef8 c112e3c3
      00000000 f0f4f148 c0021f34 f0f4f148 ee2830a4 ef9f0000 c0021f20 c112fdf8
      Call Trace:
      [<c15b7518>] dump_stack+0x41/0x52
      [<c112e0b7>] bad_page.part.72+0xa7/0x100
      [<c112e3c3>] free_pages_prepare+0x213/0x220
      [<c112fdf8>] free_hot_cold_page+0x28/0x120
      [<c1073380>] ? try_to_wake_up+0x2b0/0x2b0
      [<c112ff15>] __free_pages+0x25/0x30
      [<c112c4fd>] mempool_free_pages+0xd/0x10
      [<c112c5f1>] mempool_free+0x31/0x90
      [<f0f441cf>] f2fs_exit_crypto+0x6f/0xf0 [f2fs]
      [<f0f456c4>] exit_f2fs_fs+0x23/0x95f [f2fs]
      [<c10c30e0>] SyS_delete_module+0x130/0x180
      [<c11556d6>] ? vm_munmap+0x46/0x60
      [<c15bd888>] sysenter_do_call+0x12/0x12"
      
      The reason is that:
      
      since commit 0827e645fd35
      ("f2fs crypto: shrink size of the f2fs_crypto_ctx structure") is merged,
      some fields in f2fs_crypto_ctx structure are merged into a union as they
      will never be used simultaneously in write path, read path or on free list.
      
      In f2fs_exit_crypto, we traverse each crypto ctx from free list, in this
      moment, our free_list field in union is valid, but still we will try to
      release memory space which is pointed by other invalid field in union
      structure for each ctx.
      
      Then the error occurs, let's fix it with this patch.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b9da898b
    • C
      f2fs crypto: fix to release buffer for fname crypto · 7bf4b557
      Chao Yu 提交于
      This patch fixes memory leak issue in error path of f2fs_fname_setup_filename().
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7bf4b557
    • J
      f2fs crypto: shrink size of the f2fs_crypto_ctx structure · ca40b030
      Jaegeuk Kim 提交于
      This patch integrates the below patch into f2fs.
      
      "ext4 crypto: shrink size of the ext4_crypto_ctx structure
      
      Some fields are only used when the crypto_ctx is being used on the
      read path, some are only used on the write path, and some are only
      used when the structure is on free list.  Optimize memory use by using
      a union."
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ca40b030
    • J
      f2fs crypto: get rid of ci_mode from struct f2fs_crypt_info · 640778fb
      Jaegeuk Kim 提交于
      This patch integrates the below patch into f2fs.
      
      "ext4 crypto: get rid of ci_mode from struct ext4_crypt_info
      
      The ci_mode field was superfluous, and getting rid of it gets rid of
      an unused hole in the structure."
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      640778fb
    • J
      f2fs crypto: use slab caches · 8bacf6de
      Jaegeuk Kim 提交于
      This patch integrates the below patch into f2fs.
      
      "ext4 crypto: use slab caches
      
      Use slab caches the ext4_crypto_ctx and ext4_crypt_info structures for
      slighly better memory efficiency and debuggability."
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      8bacf6de
    • J
      f2fs: truncate data blocks for orphan inode · 06e1bc05
      Jaegeuk Kim 提交于
      As Hu reported, F2FS has a space leak problem, when conducting:
      
      1) format a 4GB f2fs partition
      2) dd a 3G file,
      3) unlink it.
      
      So, when doing f2fs_drop_inode(), we need to truncate data blocks
      before skipping it.
      We can also drop unused caches assigned to each inode.
      Reported-by: Nhujianyang <hujianyang@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      06e1bc05
    • D
      f2fs: cleanup a confusing indent · 912a83b5
      Dan Carpenter 提交于
      The return was not indented far enough so it looked like it was supposed
      to go with the other if statement.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      912a83b5
    • A
      f2fs: fix building on 32-bit architectures · 7beb428e
      Arnd Bergmann 提交于
      A bug fix to the debug output extended the type of some local
      variables to 64-bit, which now causes the kernel to fail building
      because of missing 64-bit division functions:
      
      ERROR: "__aeabi_uldivmod" [fs/f2fs/f2fs.ko] undefined!
      
      In the kernel, we have to use div_u64 or do_div to do this,
      in order to annotate that this is an expensive operation.
      
      As the function is only called for debug out, we know this
      is not performance critical, so it is safe to use div_u64.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: d1f85bd38db19 ("f2fs: avoid value overflow in showing current status")
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7beb428e
    • J
      f2fs: avoid buggy functions · e19ef527
      Jaegeuk Kim 提交于
      This patch avoids to use a buggy function for now.
      It needs to fix them later.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e19ef527
    • H
      f2fs: add compat_ioctl to provide backward compatability · 08b95126
      hujianyang 提交于
      introduce compat_ioctl to regular files, but doesn't add this
      functionality to f2fs_dir_operations.
      
      While running a 32-bit busybox, I met an error like this:
      (A is a directory)
      
      chattr: reading flags on A: Inappropriate ioctl for device
      
      This patch copies compat_ioctl from f2fs_file_operations and
      fix this problem.
      Signed-off-by: Nhujianyang <hujianyang@huawei.com>
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      08b95126
    • J
      f2fs: do not issue next dnode discard redundantly · 40a02be1
      Jaegeuk Kim 提交于
      We have a discard map, so that we can avoid redundant discard issues.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      40a02be1