<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/exfat/inode.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-12T12:21:51Z</updated>
<entry>
<title>exfat: remove unnecessary else after return statement</title>
<updated>2026-02-12T12:21:51Z</updated>
<author>
<name>William Hansen-Baird</name>
</author>
<published>2026-01-22T00:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e37a4577f95d93903c5754c6bac921ac39b557e'/>
<id>urn:sha1:5e37a4577f95d93903c5754c6bac921ac39b557e</id>
<content type='text'>
Else-branch is unnecessary after return statement in if-branch.
Remove to enhance readability and reduce indentation.

Signed-off-by: William Hansen-Baird &lt;william.hansen.baird@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: support multi-cluster for exfat_get_cluster</title>
<updated>2026-02-12T12:21:51Z</updated>
<author>
<name>Chi Zhiling</name>
</author>
<published>2026-01-14T12:18:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9276e330c17b6c926bdc5da90cbc58d6c4f26298'/>
<id>urn:sha1:9276e330c17b6c926bdc5da90cbc58d6c4f26298</id>
<content type='text'>
This patch introduces a count parameter to exfat_get_cluster, which
serves as an input parameter for the caller to specify the desired
number of clusters, and as an output parameter to store the length
of consecutive clusters.

This patch can improve read performance by reducing the number of
get_block calls in sequential read scenarios. speacially in small
cluster size.

According to my test data, the performance improvement is
approximately 10% when read FAT_CHAIN file with 512 bytes of
cluster size.

454 MB/s -&gt; 511 MB/s

Suggested-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Chi Zhiling &lt;chizhiling@kylinos.cn&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: support multi-cluster for exfat_map_cluster</title>
<updated>2026-02-12T12:21:50Z</updated>
<author>
<name>Chi Zhiling</name>
</author>
<published>2026-01-14T12:12:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=256694b22d017edcc8a0ce82a8e40742b074d509'/>
<id>urn:sha1:256694b22d017edcc8a0ce82a8e40742b074d509</id>
<content type='text'>
This patch introduces a parameter 'count' to support fetching multiple
clusters in exfat_map_cluster. The returned 'count' indicates the number
of consecutive clusters, or 0 when the input cluster offset is past EOF.

And the 'count' is also an input parameter for the caller to specify the
required number of clusters.

Only NO_FAT_CHAIN files enable multi-cluster fetching in this patch.

After this patch, the time proportion of exfat_get_block has decreased,
The performance data is as follows:

Cluster size: 512 bytes
Sequential read of a 30GB NO_FAT_CHAIN file:
2.4GB/s -&gt; 2.5 GB/s
proportion of exfat_get_block:
10.8% -&gt; 0.02%

Signed-off-by: Chi Zhiling &lt;chizhiling@kylinos.cn&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: remove handling of non-file types in exfat_map_cluster</title>
<updated>2026-02-12T12:21:50Z</updated>
<author>
<name>Chi Zhiling</name>
</author>
<published>2026-01-14T12:12:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88a936b7a918e4f37296524d355505128c961d9c'/>
<id>urn:sha1:88a936b7a918e4f37296524d355505128c961d9c</id>
<content type='text'>
Yuezhang said: "exfat_map_cluster() is only used for files. The code
in this 'else' block is never executed and can be cleaned up."

Suggested-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Chi Zhiling &lt;chizhiling@kylinos.cn&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: reduce the number of parameters for exfat_get_cluster()</title>
<updated>2026-02-12T12:21:49Z</updated>
<author>
<name>Chi Zhiling</name>
</author>
<published>2026-01-14T12:12:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afb6ffa33dab9622f7502c081b17dbc9bc9a97d0'/>
<id>urn:sha1:afb6ffa33dab9622f7502c081b17dbc9bc9a97d0</id>
<content type='text'>
Remove parameter 'fclus' and 'allow_eof':

- The fclus parameter is changed to a local variable as it is not
  needed to be returned.

- The passed allow_eof parameter was always 1, remove it and the
  associated error handling.

Signed-off-by: Chi Zhiling &lt;chizhiling@kylinos.cn&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: drop redundant conversion to bool</title>
<updated>2025-09-30T04:34:43Z</updated>
<author>
<name>Xichao Zhao</name>
</author>
<published>2025-08-18T09:28:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c88607ac82d1e375e4c85577fe54e69b0be43a9'/>
<id>urn:sha1:2c88607ac82d1e375e4c85577fe54e69b0be43a9</id>
<content type='text'>
The result of integer comparison already evaluates to bool. No need for
explicit conversion.

No functional impact.

Signed-off-by: Xichao Zhao &lt;zhao.xichao@vivo.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: change write_begin/write_end interface to take struct kiocb *</title>
<updated>2025-07-16T12:48:18Z</updated>
<author>
<name>Taotao Chen</name>
</author>
<published>2025-07-16T09:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9d8e2bf23206825ca9b4d3caf587945ba807939'/>
<id>urn:sha1:e9d8e2bf23206825ca9b4d3caf587945ba807939</id>
<content type='text'>
Change the address_space_operations callbacks write_begin() and
write_end() to take struct kiocb * as the first argument instead of
struct file *.

Update all affected function prototypes, implementations, call sites,
and related documentation across VFS, filesystems, and block layer.

Part of a series refactoring address_space_operations write_begin and
write_end callbacks to use struct kiocb for passing write context and
flags.

Signed-off-by: Taotao Chen &lt;chentaotao@didiglobal.com&gt;
Link: https://lore.kernel.org/20250716093559.217344-4-chentaotao@didiglobal.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: call bh_read in get_block only when necessary</title>
<updated>2025-03-29T13:03:11Z</updated>
<author>
<name>Sungjong Seo</name>
</author>
<published>2025-03-26T15:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c73e680d1f84059e1b1ea82a537f6ccc1c563eb4'/>
<id>urn:sha1:c73e680d1f84059e1b1ea82a537f6ccc1c563eb4</id>
<content type='text'>
With commit 11a347fb6cef ("exfat: change to get file size from DataLength"),
exfat_get_block() can now handle valid_size. However, most partial
unwritten blocks that could be mapped with other blocks are being
inefficiently processed separately as individual blocks.

Except for partial unwritten blocks that require independent processing,
let's handle them simply as before.

Signed-off-by: Sungjong Seo &lt;sj1557.seo@samsung.com&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: fix potential wrong error return from get_block</title>
<updated>2025-03-29T13:03:07Z</updated>
<author>
<name>Sungjong Seo</name>
</author>
<published>2025-03-26T14:48:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59c30e31425833385e6644ad33151420e37eabe1'/>
<id>urn:sha1:59c30e31425833385e6644ad33151420e37eabe1</id>
<content type='text'>
If there is no error, get_block() should return 0. However, when bh_read()
returns 1, get_block() also returns 1 in the same manner.

Let's set err to 0, if there is no error from bh_read()

Fixes: 11a347fb6cef ("exfat: change to get file size from DataLength")
Cc: stable@vger.kernel.org
Signed-off-by: Sungjong Seo &lt;sj1557.seo@samsung.com&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: fix random stack corruption after get_block</title>
<updated>2025-03-27T12:18:02Z</updated>
<author>
<name>Sungjong Seo</name>
</author>
<published>2025-03-21T06:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bb7ff4204b6d4927e982cd256286c09ed4fd8ca'/>
<id>urn:sha1:1bb7ff4204b6d4927e982cd256286c09ed4fd8ca</id>
<content type='text'>
When get_block is called with a buffer_head allocated on the stack, such
as do_mpage_readpage, stack corruption due to buffer_head UAF may occur in
the following race condition situation.

     &lt;CPU 0&gt;                      &lt;CPU 1&gt;
mpage_read_folio
  &lt;&lt;bh on stack&gt;&gt;
  do_mpage_readpage
    exfat_get_block
      bh_read
        __bh_read
	  get_bh(bh)
          submit_bh
          wait_on_buffer
                              ...
                              end_buffer_read_sync
                                __end_buffer_read_notouch
                                   unlock_buffer
          &lt;&lt;keep going&gt;&gt;
        ...
      ...
    ...
  ...
&lt;&lt;bh is not valid out of mpage_read_folio&gt;&gt;
   .
   .
another_function
  &lt;&lt;variable A on stack&gt;&gt;
                                   put_bh(bh)
                                     atomic_dec(bh-&gt;b_count)
  * stack corruption here *

This patch returns -EAGAIN if a folio does not have buffers when bh_read
needs to be called. By doing this, the caller can fallback to functions
like block_read_full_folio(), create a buffer_head in the folio, and then
call get_block again.

Let's do not call bh_read() with on-stack buffer_head.

Fixes: 11a347fb6cef ("exfat: change to get file size from DataLength")
Cc: stable@vger.kernel.org
Tested-by: Yeongjin Gil &lt;youngjin.gil@samsung.com&gt;
Signed-off-by: Sungjong Seo &lt;sj1557.seo@samsung.com&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
</feed>
