<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/f2fs, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-09-20T06:22:11Z</updated>
<entry>
<title>f2fs: check hot_data for roll-forward recovery</title>
<updated>2017-09-20T06:22:11Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2017-08-13T04:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb14d4cebdb29df42c4a22ebe3fcf6097138663b'/>
<id>urn:sha1:cb14d4cebdb29df42c4a22ebe3fcf6097138663b</id>
<content type='text'>
commit 125c9fb1ccb53eb2ea9380df40f3c743f3fb2fed upstream.

We need to check HOT_DATA to truncate any previous data block when doing
roll-forward recovery.

Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: let fill_super handle roll-forward errors</title>
<updated>2017-09-20T06:22:10Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2017-08-11T00:35:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96a069a6babb4a19eaaa6a7dd72943040f0a5848'/>
<id>urn:sha1:96a069a6babb4a19eaaa6a7dd72943040f0a5848</id>
<content type='text'>
commit afd2b4da40b3b567ef8d8e6881479345a2312a03 upstream.

If we set CP_ERROR_FLAG in roll-forward error, f2fs is no longer to proceed
any IOs due to f2fs_cp_error(). But, for example, if some stale data is involved
on roll-forward process, we're able to get -ENOENT, getting fs stuck.
If we get any error, let fill_super set SBI_NEED_FSCK and try to recover back
to stable point.

Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: Don't clear SGID when inheriting ACLs</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2017-07-11T21:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=893425c7201c6029d855219d14746841c8592cba'/>
<id>urn:sha1:893425c7201c6029d855219d14746841c8592cba</id>
<content type='text'>
commit c925dc162f770578ff4a65ec9b08270382dba9e6 upstream.

This patch copies commit b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: use spin_{,un}lock_irq{save,restore}</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2017-07-07T06:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65483db1a6492c52698c72f7010f83e7fd755e7d'/>
<id>urn:sha1:65483db1a6492c52698c72f7010f83e7fd755e7d</id>
<content type='text'>
commit d1aa245354ae4605d1183f542ed8d45811c439f6 upstream.

generic/361 reports below warning, this is because: once, there is
someone entering into critical region of sbi.cp_lock, if write_end_io.
f2fs_stop_checkpoint is invoked from an triggered IRQ, we will encounter
deadlock.

So this patch changes to use spin_{,un}lock_irq{save,restore} to create
critical region without IRQ enabled to avoid potential deadlock.

 irq event stamp: 83391573
 loop: Write error at byte offset 438729728, length 1024.
 hardirqs last  enabled at (83391573): [&lt;c1809752&gt;] restore_all+0xf/0x65
 hardirqs last disabled at (83391572): [&lt;c1809eac&gt;] reschedule_interrupt+0x30/0x3c
 loop: Write error at byte offset 438860288, length 1536.
 softirqs last  enabled at (83389244): [&lt;c180cc4e&gt;] __do_softirq+0x1ae/0x476
 softirqs last disabled at (83389237): [&lt;c101ca7c&gt;] do_softirq_own_stack+0x2c/0x40
 loop: Write error at byte offset 438990848, length 2048.
 ================================
 WARNING: inconsistent lock state
 4.12.0-rc2+ #30 Tainted: G           O
 --------------------------------
 inconsistent {HARDIRQ-ON-W} -&gt; {IN-HARDIRQ-W} usage.
 xfs_io/7959 [HC1[1]:SC0[0]:HE0:SE1] takes:
  (&amp;(&amp;sbi-&gt;cp_lock)-&gt;rlock){?.+...}, at: [&lt;f96f96cc&gt;] f2fs_stop_checkpoint+0x1c/0x50 [f2fs]
 {HARDIRQ-ON-W} state was registered at:
   __lock_acquire+0x527/0x7b0
   lock_acquire+0xae/0x220
   _raw_spin_lock+0x42/0x50
   do_checkpoint+0x165/0x9e0 [f2fs]
   write_checkpoint+0x33f/0x740 [f2fs]
   __f2fs_sync_fs+0x92/0x1f0 [f2fs]
   f2fs_sync_fs+0x12/0x20 [f2fs]
   sync_filesystem+0x67/0x80
   generic_shutdown_super+0x27/0x100
   kill_block_super+0x22/0x50
   kill_f2fs_super+0x3a/0x40 [f2fs]
   deactivate_locked_super+0x3d/0x70
   deactivate_super+0x40/0x60
   cleanup_mnt+0x39/0x70
   __cleanup_mnt+0x10/0x20
   task_work_run+0x69/0x80
   exit_to_usermode_loop+0x57/0x85
   do_fast_syscall_32+0x18c/0x1b0
   entry_SYSENTER_32+0x4c/0x7b
 irq event stamp: 1957420
 hardirqs last  enabled at (1957419): [&lt;c1808f37&gt;] _raw_spin_unlock_irq+0x27/0x50
 hardirqs last disabled at (1957420): [&lt;c1809f9c&gt;] call_function_single_interrupt+0x30/0x3c
 softirqs last  enabled at (1953784): [&lt;c180cc4e&gt;] __do_softirq+0x1ae/0x476
 softirqs last disabled at (1953773): [&lt;c101ca7c&gt;] do_softirq_own_stack+0x2c/0x40

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&amp;(&amp;sbi-&gt;cp_lock)-&gt;rlock);
   &lt;Interrupt&gt;
     lock(&amp;(&amp;sbi-&gt;cp_lock)-&gt;rlock);

  *** DEADLOCK ***

 2 locks held by xfs_io/7959:
  #0:  (sb_writers#13){.+.+.+}, at: [&lt;c11fd7ca&gt;] vfs_write+0x16a/0x190
  #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#16){+.+.+.}, at: [&lt;f96e33f5&gt;] f2fs_file_write_iter+0x25/0x140 [f2fs]

 stack backtrace:
 CPU: 2 PID: 7959 Comm: xfs_io Tainted: G           O    4.12.0-rc2+ #30
 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
 Call Trace:
  dump_stack+0x5f/0x92
  print_usage_bug+0x1d3/0x1dd
  ? check_usage_backwards+0xe0/0xe0
  mark_lock+0x23d/0x280
  __lock_acquire+0x699/0x7b0
  ? __this_cpu_preempt_check+0xf/0x20
  ? trace_hardirqs_off_caller+0x91/0xe0
  lock_acquire+0xae/0x220
  ? f2fs_stop_checkpoint+0x1c/0x50 [f2fs]
  _raw_spin_lock+0x42/0x50
  ? f2fs_stop_checkpoint+0x1c/0x50 [f2fs]
  f2fs_stop_checkpoint+0x1c/0x50 [f2fs]
  f2fs_write_end_io+0x147/0x150 [f2fs]
  bio_endio+0x7a/0x1e0
  blk_update_request+0xad/0x410
  blk_mq_end_request+0x16/0x60
  lo_complete_rq+0x3c/0x70
  __blk_mq_complete_request_remote+0x11/0x20
  flush_smp_call_function_queue+0x6d/0x120
  ? debug_smp_processor_id+0x12/0x20
  generic_smp_call_function_single_interrupt+0x12/0x30
  smp_call_function_single_interrupt+0x25/0x40
  call_function_single_interrupt+0x37/0x3c
 EIP: _raw_spin_unlock_irq+0x2d/0x50
 EFLAGS: 00000296 CPU: 2
 EAX: 00000001 EBX: d2ccc51c ECX: 00000001 EDX: c1aacebd
 ESI: 00000000 EDI: 00000000 EBP: c96c9d1c ESP: c96c9d18
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
  ? inherit_task_group.isra.98.part.99+0x6b/0xb0
  __add_to_page_cache_locked+0x1d4/0x290
  add_to_page_cache_lru+0x38/0xb0
  pagecache_get_page+0x8e/0x200
  f2fs_write_begin+0x96/0xf00 [f2fs]
  ? trace_hardirqs_on_caller+0xdd/0x1c0
  ? current_time+0x17/0x50
  ? trace_hardirqs_on+0xb/0x10
  generic_perform_write+0xa9/0x170
  __generic_file_write_iter+0x1a2/0x1f0
  ? f2fs_preallocate_blocks+0x137/0x160 [f2fs]
  f2fs_file_write_iter+0x6e/0x140 [f2fs]
  ? __lock_acquire+0x429/0x7b0
  __vfs_write+0xc1/0x140
  vfs_write+0x9b/0x190
  SyS_pwrite64+0x63/0xa0
  do_fast_syscall_32+0xa1/0x1b0
  entry_SYSENTER_32+0x4c/0x7b
 EIP: 0xb7786c61
 EFLAGS: 00000293 CPU: 2
 EAX: ffffffda EBX: 00000003 ECX: 08416000 EDX: 00001000
 ESI: 18b24000 EDI: 00000000 EBP: 00000003 ESP: bf9b36b0
  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b

Fixes: aaec2b1d1879 ("f2fs: introduce cp_lock to protect updating of ckpt_flags")
Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: sanity check size of nat and sit cache</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Jin Qian</name>
</author>
<published>2017-06-01T18:18:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0f0ccf8f4c246f36ff06c9b409f9cae1630bea6'/>
<id>urn:sha1:d0f0ccf8f4c246f36ff06c9b409f9cae1630bea6</id>
<content type='text'>
commit 21d3f8e1c3b7996ce239ab6fa82e9f7a8c47d84d upstream.

Make sure number of entires doesn't exceed max journal size.

Signed-off-by: Jin Qian &lt;jinqian@android.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: Do not issue small discards in LFS mode</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Damien Le Moal</name>
</author>
<published>2017-05-26T08:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dca54568b79d67bb736ea9dc272c460d4a488c0b'/>
<id>urn:sha1:dca54568b79d67bb736ea9dc272c460d4a488c0b</id>
<content type='text'>
commit acfd2810c75b0625897fc119a2d3a9c26cc0e405 upstream.

clear_prefree_segments() issues small discards after discarding full
segments. These small discards may not be section aligned, so not zone
aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
Fix this by not issuing small discards for a volume mounted with the BLKZONED
feature enabled.

Signed-off-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: try to freeze in gc and discard threads</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2017-05-17T17:36:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4567789d3343fd56ff5b1afa096634ff89d0d670'/>
<id>urn:sha1:4567789d3343fd56ff5b1afa096634ff89d0d670</id>
<content type='text'>
commit 1d7be2708277edfef95171d52fb65ee26eaa076b upstream.

This allows to freeze gc and discard threads.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: sanity check checkpoint segno and blkoff</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Jin Qian</name>
</author>
<published>2017-05-15T17:45:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55df2e68c21714444fc3056c5636531ee9d1bc58'/>
<id>urn:sha1:55df2e68c21714444fc3056c5636531ee9d1bc58</id>
<content type='text'>
commit 15d3042a937c13f5d9244241c7a9c8416ff6e82a upstream.

Make sure segno and blkoff read from raw image are valid.

Signed-off-by: Jin Qian &lt;jinqian@google.com&gt;
[Jaegeuk Kim: adjust minor coding style]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: wake up all waiters in f2fs_submit_discard_endio</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2017-05-19T15:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=378560b8c2b3560263b6b56a4d5fe8d2b4931f0e'/>
<id>urn:sha1:378560b8c2b3560263b6b56a4d5fe8d2b4931f0e</id>
<content type='text'>
commit e31b98215779e66a490471c6ad886ae231316699 upstream.

There could be more than one waiter waiting discard IO completion, so we
need use complete_all() instead of complete() in f2fs_submit_discard_endio
to avoid hungtask.

Fixes: 	ec9895add2c5 ("f2fs: don't hold cmd_lock during waiting discard
command")
Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: load inode's flag from disk</title>
<updated>2017-07-27T22:10:15Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2017-05-16T20:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9aabcf47906df581f57a9c5b3e617e0c18b3fd7a'/>
<id>urn:sha1:9aabcf47906df581f57a9c5b3e617e0c18b3fd7a</id>
<content type='text'>
commit 93607124c5450148e592c3d18ac533b4e5f25b8b upstream.

This patch fixes missing inode flag loaded from disk, reported by Tom.

[tom@localhost ~]$ sudo mount /dev/loop0 /mnt/
[tom@localhost ~]$ sudo chown tom:tom /mnt/
[tom@localhost ~]$ touch /mnt/testfile
[tom@localhost ~]$ sudo chattr +i /mnt/testfile
[tom@localhost ~]$ echo test &gt; /mnt/testfile
bash: /mnt/testfile: Operation not permitted
[tom@localhost ~]$ rm /mnt/testfile
rm: cannot remove '/mnt/testfile': Operation not permitted
[tom@localhost ~]$ sudo umount /mnt/
[tom@localhost ~]$ sudo mount /dev/loop0 /mnt/
[tom@localhost ~]$ lsattr /mnt/testfile
----i-------------- /mnt/testfile
[tom@localhost ~]$ echo test &gt; /mnt/testfile
[tom@localhost ~]$ rm /mnt/testfile
[tom@localhost ~]$ sudo umount /mnt/

Reported-by: Tom Yan &lt;tom.ty89@outlook.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
