<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/exfat/inode.c, branch linux-rolling-lts</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-09-30T04:34:43Z</updated>
<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>
<entry>
<title>exfat: add exfat_get_dentry_set_by_ei() helper</title>
<updated>2024-11-25T08:08:23Z</updated>
<author>
<name>Yuezhang Mo</name>
</author>
<published>2024-09-13T05:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac844e91364a03c35838fd488437605fbe56f8c3'/>
<id>urn:sha1:ac844e91364a03c35838fd488437605fbe56f8c3</id>
<content type='text'>
This helper gets the directory entry set of the file for the exfat
inode which has been created.

It's used to remove all the instances of the pattern it replaces
making the code cleaner, it's also a preparation for changing -&gt;dir
to record the cluster where the directory entry set is located and
changing -&gt;entry to record the index of the directory entry within
the cluster.

Signed-off-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Reviewed-by: Aoyama Wataru &lt;wataru.aoyama@sony.com&gt;
Reviewed-by: Daniel Palmer &lt;daniel.palmer@sony.com&gt;
Reviewed-by: Sungjong Seo &lt;sj1557.seo@samsung.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: Implement sops-&gt;shutdown and ioctl</title>
<updated>2024-09-17T22:40:56Z</updated>
<author>
<name>Dongliang Cui</name>
</author>
<published>2024-09-17T22:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f761fcdd289d07e8547fef7ac76c3760fc7803f2'/>
<id>urn:sha1:f761fcdd289d07e8547fef7ac76c3760fc7803f2</id>
<content type='text'>
We found that when writing a large file through buffer write, if the
disk is inaccessible, exFAT does not return an error normally, which
leads to the writing process not stopping properly.

To easily reproduce this issue, you can follow the steps below:

1. format a device to exFAT and then mount (with a full disk erase)
2. dd if=/dev/zero of=/exfat_mount/test.img bs=1M count=8192
3. eject the device

You may find that the dd process does not stop immediately and may
continue for a long time.

The root cause of this issue is that during buffer write process,
exFAT does not need to access the disk to look up directory entries
or the FAT table (whereas FAT would do) every time data is written.
Instead, exFAT simply marks the buffer as dirty and returns,
delegating the writeback operation to the writeback process.

If the disk cannot be accessed at this time, the error will only be
returned to the writeback process, and the original process will not
receive the error, so it cannot be returned to the user side.

When the disk cannot be accessed normally, an error should be returned
to stop the writing process.

Implement sops-&gt;shutdown and ioctl to shut down the file system
when underlying block device is marked dead.

Signed-off-by: Dongliang Cui &lt;dongliang.cui@unisoc.com&gt;
Signed-off-by: Zhiguo Niu &lt;zhiguo.niu@unisoc.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: do not fallback to buffered write</title>
<updated>2024-09-17T06:09:50Z</updated>
<author>
<name>Yuezhang Mo</name>
</author>
<published>2024-09-17T05:58:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=231eb762bbe8fa232e672e5a399eed16a0c0c45a'/>
<id>urn:sha1:231eb762bbe8fa232e672e5a399eed16a0c0c45a</id>
<content type='text'>
After commit(11a347fb6cef exfat: change to get file size from
DataLength), the remaining area or hole had been filled with
zeros before calling exfat_direct_IO(), so there is no need to
fallback to buffered write, and -&gt;i_size_aligned is no longer
needed, drop it.

Signed-off-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 -&gt;i_size_ondisk</title>
<updated>2024-09-17T05:46:51Z</updated>
<author>
<name>Yuezhang Mo</name>
</author>
<published>2024-01-12T02:32:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fba27cf005038a5fedf001b49636594819dbb1d5'/>
<id>urn:sha1:fba27cf005038a5fedf001b49636594819dbb1d5</id>
<content type='text'>
-&gt;i_size_ondisk is no longer used by exfat_write_begin() after
commit(11a347fb6cef exfat: change to get file size from DataLength),
drop it.

Signed-off-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: Convert aops-&gt;write_begin to take a folio</title>
<updated>2024-08-07T09:33:21Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-07-15T18:24:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1da86618bdce301d23e89ecce92161f9d3b3c5e7'/>
<id>urn:sha1:1da86618bdce301d23e89ecce92161f9d3b3c5e7</id>
<content type='text'>
Convert all callers from working on a page to working on one page
of a folio (support for working on an entire folio can come later).
Removes a lot of folio-&gt;page-&gt;folio conversions.

Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
