<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/fs/squashfs, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/fs/squashfs?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/fs/squashfs?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-28T20:37:21Z</updated>
<entry>
<title>squashfs: fix buffer release race condition in readahead code</title>
<updated>2022-10-28T20:37:21Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-10-20T22:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e11c4e088be4c39d17f304fcf331670891905f42'/>
<id>urn:sha1:e11c4e088be4c39d17f304fcf331670891905f42</id>
<content type='text'>
Fix a buffer release race condition, where the error value was used after
release.

Link: https://lkml.kernel.org/r/20221020223616.7571-4-phillip@squashfs.org.uk
Fixes: b09a7a036d20 ("squashfs: support reading fragments in readahead call")
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Tested-by: Bagas Sanjaya &lt;bagasdotme@gmail.com&gt;
Reported-by: Marc Miltenberger &lt;marcmiltenberger@gmail.com&gt;
Cc: Dimitri John Ledkov &lt;dimitri.ledkov@canonical.com&gt;
Cc: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Cc: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Cc: Slade Watkins &lt;srw@sladewatkins.net&gt;
Cc: Thorsten Leemhuis &lt;regressions@leemhuis.info&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: fix extending readahead beyond end of file</title>
<updated>2022-10-28T20:37:21Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-10-20T22:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c9199de82bad03bceb94ec3c5195c879d7e11911'/>
<id>urn:sha1:c9199de82bad03bceb94ec3c5195c879d7e11911</id>
<content type='text'>
The readahead code will try to extend readahead to the entire size of the
Squashfs data block.

But, it didn't take into account that the last block at the end of the
file may not be a whole block.  In this case, the code would extend
readahead to beyond the end of the file, leaving trailing pages.

Fix this by only requesting the expected number of pages.

Link: https://lkml.kernel.org/r/20221020223616.7571-3-phillip@squashfs.org.uk
Fixes: 8fc78b6fe24c ("squashfs: implement readahead")
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Tested-by: Bagas Sanjaya &lt;bagasdotme@gmail.com&gt;
Reported-by: Marc Miltenberger &lt;marcmiltenberger@gmail.com&gt;
Cc: Dimitri John Ledkov &lt;dimitri.ledkov@canonical.com&gt;
Cc: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Cc: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Cc: Slade Watkins &lt;srw@sladewatkins.net&gt;
Cc: Thorsten Leemhuis &lt;regressions@leemhuis.info&gt;
Cc: &lt;stable@vger.kernel.org&gt;

Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: fix read regression introduced in readahead code</title>
<updated>2022-10-28T20:37:21Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-10-20T22:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9ef8eb6104527bfe9ed31f7a4ffa721390adf9a8'/>
<id>urn:sha1:9ef8eb6104527bfe9ed31f7a4ffa721390adf9a8</id>
<content type='text'>
Patch series "squashfs: fix some regressions introduced in the readahead
code".

This patchset fixes 3 regressions introduced by the recent readahead code
changes.  The first regression is causing "snaps" to randomly fail after a
couple of hours or days, which how the regression came to light.


This patch (of 3):

If a file isn't a whole multiple of the page size, the last page will have
trailing bytes unfilled.

There was a mistake in the readahead code which did this.  In particular
it incorrectly assumed that the last page in the readahead page array
(page[nr_pages - 1]) will always contain the last page in the block, which
if we're at file end, will be the page that needs to be zero filled.

But the readahead code may not return the last page in the block, which
means it is unmapped and will be skipped by the decompressors (a temporary
buffer used).

In this case the zero filling code will zero out the wrong page, leading
to data corruption.

Fix this by by extending the "page actor" to return the last page if
present, or NULL if a temporary buffer was used.

Link: https://lkml.kernel.org/r/20221020223616.7571-1-phillip@squashfs.org.uk
Link: https://lkml.kernel.org/r/20221020223616.7571-2-phillip@squashfs.org.uk
Fixes: 8fc78b6fe24c ("squashfs: implement readahead")
Link: https://lore.kernel.org/lkml/b0c258c3-6dcf-aade-efc4-d62a8b3a1ce2@alu.unizg.hr/
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Reported-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Tested-by: Mirsad Goran Todorovac &lt;mirsad.todorovac@alu.unizg.hr&gt;
Tested-by: Slade Watkins &lt;srw@sladewatkins.net&gt;
Tested-by: Bagas Sanjaya &lt;bagasdotme@gmail.com&gt;
Reported-by: Marc Miltenberger &lt;marcmiltenberger@gmail.com&gt;
Cc: Dimitri John Ledkov &lt;dimitri.ledkov@canonical.com&gt;
Cc: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Cc: Thorsten Leemhuis &lt;regressions@leemhuis.info&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: don't call kmalloc in decompressors</title>
<updated>2022-08-28T21:02:45Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-08-22T21:54:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1f13dff09ffc8bcf6aa20639b638d813379c7f6b'/>
<id>urn:sha1:1f13dff09ffc8bcf6aa20639b638d813379c7f6b</id>
<content type='text'>
The decompressors may be called while in an atomic section.  So move the
kmalloc() out of this path, and into the "page actor" init function.

This fixes a regression introduced by commit
f268eedddf35 ("squashfs: extend "page actor" to handle missing pages")

Link: https://lkml.kernel.org/r/20220822215430.15933-1-phillip@squashfs.org.uk
Fixes: f268eedddf35 ("squashfs: extend "page actor" to handle missing pages")
Reported-by: Chris Murphy &lt;lists@colorremedies.com&gt;
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2022-08-07T17:03:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-08-07T17:03:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=eb5699ba31558bdb2cee6ebde3d0a68091e47dce'/>
<id>urn:sha1:eb5699ba31558bdb2cee6ebde3d0a68091e47dce</id>
<content type='text'>
Pull misc updates from Andrew Morton:
 "Updates to various subsystems which I help look after. lib, ocfs2,
  fatfs, autofs, squashfs, procfs, etc. A relatively small amount of
  material this time"

* tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits)
  scripts/gdb: ensure the absolute path is generated on initial source
  MAINTAINERS: kunit: add David Gow as a maintainer of KUnit
  mailmap: add linux.dev alias for Brendan Higgins
  mailmap: update Kirill's email
  profile: setup_profiling_timer() is moslty not implemented
  ocfs2: fix a typo in a comment
  ocfs2: use the bitmap API to simplify code
  ocfs2: remove some useless functions
  lib/mpi: fix typo 'the the' in comment
  proc: add some (hopefully) insightful comments
  bdi: remove enum wb_congested_state
  kernel/hung_task: fix address space of proc_dohung_task_timeout_secs
  lib/lzo/lzo1x_compress.c: replace ternary operator with min() and min_t()
  squashfs: support reading fragments in readahead call
  squashfs: implement readahead
  squashfs: always build "file direct" version of page actor
  Revert "squashfs: provide backing_dev_info in order to disable read-ahead"
  fs/ocfs2: Fix spelling typo in comment
  ia64: old_rr4 added under CONFIG_HUGETLB_PAGE
  proc: fix test for "vsyscall=xonly" boot option
  ...
</content>
</entry>
<entry>
<title>squashfs: Return the actual error from squashfs_read_folio()</title>
<updated>2022-08-02T16:34:02Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-05-27T03:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=31e748e4b1df84dbb136f2e1dc542daefbe202b2'/>
<id>urn:sha1:31e748e4b1df84dbb136f2e1dc542daefbe202b2</id>
<content type='text'>
Since we actually know what error happened, we can report it instead
of having the generic code return -EIO for pages that were unlocked
without being marked uptodate.  Also remove a test of PageError since
we have the return value at this point.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>squashfs: support reading fragments in readahead call</title>
<updated>2022-07-30T01:12:34Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-06-17T08:38:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b09a7a036d2035b14636cd4c4c69518d73770f65'/>
<id>urn:sha1:b09a7a036d2035b14636cd4c4c69518d73770f65</id>
<content type='text'>
Add a function which can be used to read fragments in the readahead call.

This function is necessary because filesystems built with the -tailends
(or -always-use-fragments) option may have fragments present which cannot
be currently handled.

Link: https://lkml.kernel.org/r/20220617083810.337573-5-hsinyi@chromium.org
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Cc: Hou Tao &lt;houtao1@huawei.com&gt;
Cc: kernel test robot &lt;lkp@intel.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Miao Xie &lt;miaoxie@huawei.com&gt;
Cc: Xiongwei Song &lt;Xiongwei.Song@windriver.com&gt;
Cc: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Cc: Zheng Liang &lt;zhengliang6@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: implement readahead</title>
<updated>2022-07-30T01:12:34Z</updated>
<author>
<name>Hsin-Yi Wang</name>
<email>hsinyi@chromium.org</email>
</author>
<published>2022-06-17T08:38:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8fc78b6fe24c36b151ac98d7546591ed92083d4f'/>
<id>urn:sha1:8fc78b6fe24c36b151ac98d7546591ed92083d4f</id>
<content type='text'>
Implement readahead callback for squashfs.  It will read datablocks which
cover pages in readahead request.  For a few cases it will not mark page
as uptodate, including:

- file end is 0.
- zero filled blocks.
- current batch of pages isn't in the same datablock.
- decompressor error.

Otherwise pages will be marked as uptodate.  The unhandled pages will be
updated by readpage later.

Link: https://lkml.kernel.org/r/20220617083810.337573-4-hsinyi@chromium.org
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Suggested-by: Matthew Wilcox &lt;willy@infradead.org&gt;
Reported-by: Matthew Wilcox &lt;willy@infradead.org&gt;
Reported-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Reported-by: Xiongwei Song &lt;Xiongwei.Song@windriver.com&gt;
Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Hou Tao &lt;houtao1@huawei.com&gt;
Cc: kernel test robot &lt;lkp@intel.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Miao Xie &lt;miaoxie@huawei.com&gt;
Cc: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Cc: Zheng Liang &lt;zhengliang6@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: always build "file direct" version of page actor</title>
<updated>2022-07-30T01:12:34Z</updated>
<author>
<name>Phillip Lougher</name>
<email>phillip@squashfs.org.uk</email>
</author>
<published>2022-06-17T08:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=db98b43086275350294f5c6f797249b714d6316d'/>
<id>urn:sha1:db98b43086275350294f5c6f797249b714d6316d</id>
<content type='text'>
Squashfs_readahead uses the "file direct" version of the page actor, and
so build it unconditionally.

Link: https://lkml.kernel.org/r/20220617083810.337573-3-hsinyi@chromium.org
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Cc: Hou Tao &lt;houtao1@huawei.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Miao Xie &lt;miaoxie@huawei.com&gt;
Cc: Xiongwei Song &lt;Xiongwei.Song@windriver.com&gt;
Cc: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Cc: Zheng Liang &lt;zhengliang6@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "squashfs: provide backing_dev_info in order to disable read-ahead"</title>
<updated>2022-07-30T01:12:34Z</updated>
<author>
<name>Hsin-Yi Wang</name>
<email>hsinyi@chromium.org</email>
</author>
<published>2022-06-17T08:38:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0c12185728d602c27cd12a845249e7f37197f71f'/>
<id>urn:sha1:0c12185728d602c27cd12a845249e7f37197f71f</id>
<content type='text'>
Patch series "Implement readahead for squashfs", v7.

Commit 9eec1d897139("squashfs: provide backing_dev_info in order to
disable read-ahead") mitigates the performance drop issue for squashfs by
closing readahead for it.

This series implements readahead callback for squashfs.


This patch (of 4):

This reverts 9eec1d897139e5 ("squashfs: provide backing_dev_info in order
to disable read-ahead").

Revert closing the readahead to squashfs since the readahead callback for
squashfs is implemented.

Link: https://lkml.kernel.org/r/20220617083810.337573-1-hsinyi@chromium.org
Link: https://lkml.kernel.org/r/20220617083810.337573-2-hsinyi@chromium.org
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Suggested-by: Xiongwei Song &lt;Xiongwei.Song@windriver.com&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Zheng Liang &lt;zhengliang6@huawei.com&gt;
Cc: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Cc: Hou Tao &lt;houtao1@huawei.com&gt;
Cc: Miao Xie &lt;miaoxie@huawei.com&gt;

Cc: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
</feed>
