<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/fs/f2fs/debug.c, branch v5.6</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=v5.6</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=v5.6'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2020-01-23T17:24:25Z</updated>
<entry>
<title>f2fs: Add f2fs stats to sysfs</title>
<updated>2020-01-23T17:24:25Z</updated>
<author>
<name>Hridya Valsaraju</name>
<email>hridya@google.com</email>
</author>
<published>2020-01-22T18:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fc7100ea2a52fcf200be75421bfd32652827d287'/>
<id>urn:sha1:fc7100ea2a52fcf200be75421bfd32652827d287</id>
<content type='text'>
Currently f2fs stats are only available from /d/f2fs/status. This patch
adds some of the f2fs stats to sysfs so that they are accessible even
when debugfs is not mounted.

The following sysfs nodes are added:
-/sys/fs/f2fs/&lt;disk&gt;/free_segments
-/sys/fs/f2fs/&lt;disk&gt;/cp_foreground_calls
-/sys/fs/f2fs/&lt;disk&gt;/cp_background_calls
-/sys/fs/f2fs/&lt;disk&gt;/gc_foreground_calls
-/sys/fs/f2fs/&lt;disk&gt;/gc_background_calls
-/sys/fs/f2fs/&lt;disk&gt;/moved_blocks_foreground
-/sys/fs/f2fs/&lt;disk&gt;/moved_blocks_background
-/sys/fs/f2fs/&lt;disk&gt;/avg_vblocks

Signed-off-by: Hridya Valsaraju &lt;hridya@google.com&gt;
[Jaegeuk Kim: allow STAT_FS without DEBUG_FS]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: support data compression</title>
<updated>2020-01-18T00:48:07Z</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2019-11-01T10:07:14Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=4c8ff7095bef64fc47e996a938f7d57f9e077da3'/>
<id>urn:sha1:4c8ff7095bef64fc47e996a938f7d57f9e077da3</id>
<content type='text'>
This patch tries to support compression in f2fs.

- New term named cluster is defined as basic unit of compression, file can
be divided into multiple clusters logically. One cluster includes 4 &lt;&lt; n
(n &gt;= 0) logical pages, compression size is also cluster size, each of
cluster can be compressed or not.

- In cluster metadata layout, one special flag is used to indicate cluster
is compressed one or normal one, for compressed cluster, following metadata
maps cluster to [1, 4 &lt;&lt; n - 1] physical blocks, in where f2fs stores
data including compress header and compressed data.

- In order to eliminate write amplification during overwrite, F2FS only
support compression on write-once file, data can be compressed only when
all logical blocks in file are valid and cluster compress ratio is lower
than specified threshold.

- To enable compression on regular inode, there are three ways:
* chattr +c file
* chattr +c dir; touch dir/file
* mount w/ -o compress_extension=ext; touch file.ext

Compress metadata layout:
                             [Dnode Structure]
             +-----------------------------------------------+
             | cluster 1 | cluster 2 | ......... | cluster N |
             +-----------------------------------------------+
             .           .                       .           .
       .                       .                .                      .
  .         Compressed Cluster       .        .        Normal Cluster            .
+----------+---------+---------+---------+  +---------+---------+---------+---------+
|compr flag| block 1 | block 2 | block 3 |  | block 1 | block 2 | block 3 | block 4 |
+----------+---------+---------+---------+  +---------+---------+---------+---------+
           .                             .
         .                                           .
       .                                                           .
      +-------------+-------------+----------+----------------------------+
      | data length | data chksum | reserved |      compressed data       |
      +-------------+-------------+----------+----------------------------+

Changelog:

20190326:
- fix error handling of read_end_io().
- remove unneeded comments in f2fs_encrypt_one_page().

20190327:
- fix wrong use of f2fs_cluster_is_full() in f2fs_mpage_readpages().
- don't jump into loop directly to avoid uninitialized variables.
- add TODO tag in error path of f2fs_write_cache_pages().

20190328:
- fix wrong merge condition in f2fs_read_multi_pages().
- check compressed file in f2fs_post_read_required().

20190401
- allow overwrite on non-compressed cluster.
- check cluster meta before writing compressed data.

20190402
- don't preallocate blocks for compressed file.

- add lz4 compress algorithm
- process multiple post read works in one workqueue
  Now f2fs supports processing post read work in multiple workqueue,
  it shows low performance due to schedule overhead of multiple
  workqueue executing orderly.

20190921
- compress: support buffered overwrite
C: compress cluster flag
V: valid block address
N: NEW_ADDR

One cluster contain 4 blocks

 before overwrite   after overwrite

- VVVV		-&gt;	CVNN
- CVNN		-&gt;	VVVV

- CVNN		-&gt;	CVNN
- CVNN		-&gt;	CVVV

- CVVV		-&gt;	CVNN
- CVVV		-&gt;	CVVV

20191029
- add kconfig F2FS_FS_COMPRESSION to isolate compression related
codes, add kconfig F2FS_FS_{LZO,LZ4} to cover backend algorithm.
note that: will remove lzo backend if Jaegeuk agreed that too.
- update codes according to Eric's comments.

20191101
- apply fixes from Jaegeuk

20191113
- apply fixes from Jaegeuk
- split workqueue for fsverity

20191216
- apply fixes from Jaegeuk

20200117
- fix to avoid NULL pointer dereference

[Jaegeuk Kim]
- add tracepoint for f2fs_{,de}compress_pages()
- fix many bugs and add some compression stats
- fix overwrite/mmap bugs
- address 32bit build error, reported by Geert.
- bug fixes when handling errors and i_compressed_blocks

Reported-by: &lt;noreply@ellerman.id.au&gt;
Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: cleanup duplicate stats for atomic files</title>
<updated>2020-01-15T21:43:48Z</updated>
<author>
<name>Sahitya Tummala</name>
<email>stummala@codeaurora.org</email>
</author>
<published>2019-12-05T03:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=0e6d01643c207fdcd77b9b40c29cbe1c63f03c15'/>
<id>urn:sha1:0e6d01643c207fdcd77b9b40c29cbe1c63f03c15</id>
<content type='text'>
Remove duplicate sbi-&gt;aw_cnt stats counter that tracks
the number of atomic files currently opened (it also shows
incorrect value sometimes). Use more relit lable sbi-&gt;atomic_files
to show in the stats.

Signed-off-by: Sahitya Tummala &lt;stummala@codeaurora.org&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()</title>
<updated>2019-08-23T14:57:12Z</updated>
<author>
<name>Jia-Ju Bai</name>
<email>baijiaju1990@gmail.com</email>
</author>
<published>2019-07-26T03:45:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=280fd422958187ac5f069c08d84dd65f7f87c2e6'/>
<id>urn:sha1:280fd422958187ac5f069c08d84dd65f7f87c2e6</id>
<content type='text'>
In fill_super() and put_super(), f2fs_destroy_stats() is called
in prior to f2fs_destroy_segment_manager(), so if current
sbi can still be visited in global stat list, SM_I(sbi) should be
released yet.
For this reason, SM_I(sbi) does not need to be checked in
update_general_status().
Thank Chao Yu for advice.

Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: ioctl for removing a range from F2FS</title>
<updated>2019-07-02T22:39:24Z</updated>
<author>
<name>Qiuyang Sun</name>
<email>sunqiuyang@huawei.com</email>
</author>
<published>2019-06-05T03:33:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=04f0b2eaa3b3ee243df6040617b4bfbbc0404854'/>
<id>urn:sha1:04f0b2eaa3b3ee243df6040617b4bfbbc0404854</id>
<content type='text'>
This ioctl shrinks a given length (aligned to sections) from end of the
main area. Any cursegs and valid blocks will be moved out before
invalidating the range.

This feature can be used for adjusting partition sizes online.

History of the patch:

Sahitya Tummala:
 - Add this ioctl for f2fs_compat_ioctl() as well.
 - Fix debugfs status to reflect the online resize changes.
 - Fix potential race between online resize path and allocate new data
   block path or gc path.

Others:
 - Rename some identifiers.
 - Add some error handling branches.
 - Clear sbi-&gt;next_victim_seg[BG_GC/FG_GC] in shrinking range.
 - Implement this interface as ext4's, and change the parameter from shrunk
bytes to new block count of F2FS.
 - During resizing, force to empty sit_journal and forbid adding new
   entries to it, in order to avoid invalid segno in journal after resize.
 - Reduce sbi-&gt;user_block_count before resize starts.
 - Commit the updated superblock first, and then update in-memory metadata
   only when the former succeeds.
 - Target block count must align to sections.
 - Write checkpoint before and after committing the new superblock, w/o
CP_FSCK_FLAG respectively, so that the FS can be fixed by fsck even if
resize fails after the new superblock is committed.
 - In free_segment_range(), reduce granularity of gc_mutex.
 - Add protection on curseg migration.
 - Add freeze_bdev() and thaw_bdev() for resize fs.
 - Remove CUR_MAIN_SECS and use MAIN_SECS directly for allocation.
 - Recover super_block and FS metadata when resize fails.
 - No need to clear CP_FSCK_FLAG in update_ckpt_flags().
 - Clean up the sb and fs metadata update functions for resize_fs.

Geert Uytterhoeven:
 - Use div_u64*() for 64-bit divisions

Arnd Bergmann:
 - Not all architectures support get_user() with a 64-bit argument:
    ERROR: "__get_user_bad" [fs/f2fs/f2fs.ko] undefined!
    Use copy_from_user() here, this will always work.

Signed-off-by: Qiuyang Sun &lt;sunqiuyang@huawei.com&gt;
Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Sahitya Tummala &lt;stummala@codeaurora.org&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: no need to check return value of debugfs_create functions</title>
<updated>2019-01-09T04:41:09Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-01-04T13:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c20e57b32d817d35271c4b205cb6ab80d8d93aeb'/>
<id>urn:sha1:c20e57b32d817d35271c4b205cb6ab80d8d93aeb</id>
<content type='text'>
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Cc: Chao Yu &lt;yuchao0@huawei.com&gt;
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: don't access node/meta inode mapping after iput</title>
<updated>2019-01-08T17:34:27Z</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2019-01-01T08:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7c77bf7de1574ac7a31a2b76f4927404307d13e7'/>
<id>urn:sha1:7c77bf7de1574ac7a31a2b76f4927404307d13e7</id>
<content type='text'>
This fixes wrong access of address spaces of node and meta inodes after iput.

Fixes: 60aa4d5536ab ("f2fs: fix use-after-free issue when accessing sbi-&gt;stat_info")
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: correct wrong spelling, issing_*</title>
<updated>2018-12-26T23:16:54Z</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2018-12-14T00:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=72691af6dbd719349c559117652a70bfd4309ad2'/>
<id>urn:sha1:72691af6dbd719349c559117652a70bfd4309ad2</id>
<content type='text'>
Let's use "queued" instead of "issuing".

Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: use kvmalloc, if kmalloc is failed</title>
<updated>2018-12-26T23:16:53Z</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2018-12-14T02:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=5222595d093ebe80329d38d255d14316257afb3e'/>
<id>urn:sha1:5222595d093ebe80329d38d255d14316257afb3e</id>
<content type='text'>
One report says memalloc failure during mount.

 (unwind_backtrace) from [&lt;c010cd4c&gt;] (show_stack+0x10/0x14)
 (show_stack) from [&lt;c049c6b8&gt;] (dump_stack+0x8c/0xa0)
 (dump_stack) from [&lt;c024fcf0&gt;] (warn_alloc+0xc4/0x160)
 (warn_alloc) from [&lt;c0250218&gt;] (__alloc_pages_nodemask+0x3f4/0x10d0)
 (__alloc_pages_nodemask) from [&lt;c0270450&gt;] (kmalloc_order_trace+0x2c/0x120)
 (kmalloc_order_trace) from [&lt;c03fa748&gt;] (build_node_manager+0x35c/0x688)
 (build_node_manager) from [&lt;c03de494&gt;] (f2fs_fill_super+0xf0c/0x16cc)
 (f2fs_fill_super) from [&lt;c02a5864&gt;] (mount_bdev+0x15c/0x188)
 (mount_bdev) from [&lt;c03da624&gt;] (f2fs_mount+0x18/0x20)
 (f2fs_mount) from [&lt;c02a68b8&gt;] (mount_fs+0x158/0x19c)
 (mount_fs) from [&lt;c02c3c9c&gt;] (vfs_kern_mount+0x78/0x134)
 (vfs_kern_mount) from [&lt;c02c76ac&gt;] (do_mount+0x474/0xca4)
 (do_mount) from [&lt;c02c8264&gt;] (SyS_mount+0x94/0xbc)
 (SyS_mount) from [&lt;c0108180&gt;] (ret_fast_syscall+0x0/0x48)

Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: add to account direct IO</title>
<updated>2018-11-26T23:53:56Z</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2018-11-11T16:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=02b16d0a34a188a21d08be52b37505e531aa558a'/>
<id>urn:sha1:02b16d0a34a188a21d08be52b37505e531aa558a</id>
<content type='text'>
This patch adds f2fs_dio_submit_bio() to hook submit_io/end_io functions
in direct IO path, in order to account DIO.

Later, we will add this count into is_idle() to let background GC/Discard
thread be aware of DIO.

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
</feed>
