<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/affs, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-04-10T12:33:38+00:00</updated>
<entry>
<title>affs: don't write overlarge OFS data block size fields</title>
<updated>2025-04-10T12:33:38+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2025-02-20T08:14:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6387243bfec9213efc9d97a16a54b55d7a85bc1e'/>
<id>urn:sha1:6387243bfec9213efc9d97a16a54b55d7a85bc1e</id>
<content type='text'>
[ Upstream commit 011ea742a25a77bac3d995f457886a67d178c6f0 ]

If a data sector on an OFS floppy contains a value &gt; 0x1e8 (the
largest amount of data that fits in the sector after its header), then
an Amiga reading the file can return corrupt data, by taking the
overlarge size at its word and reading past the end of the buffer it
read the disk sector into!

The cause: when affs_write_end_ofs() writes data to an OFS filesystem,
the new size field for a data block was computed by adding the amount
of data currently being written (into the block) to the existing value
of the size field. This is correct if you're extending the file at the
end, but if you seek backwards in the file and overwrite _existing_
data, it can lead to the size field being larger than the maximum
legal value.

This commit changes the calculation so that it sets the size field to
the max of its previous size and the position within the block that we
just wrote up to.

Signed-off-by: Simon Tatham &lt;anakin@pobox.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>affs: generate OFS sequence numbers starting at 1</title>
<updated>2025-04-10T12:33:38+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2025-02-20T08:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=395041688ba13e5a2b3049915abfde3bbc519c73'/>
<id>urn:sha1:395041688ba13e5a2b3049915abfde3bbc519c73</id>
<content type='text'>
[ Upstream commit e4cf8ec4de4e13f156c1d61977d282d90c221085 ]

If I write a file to an OFS floppy image, and try to read it back on
an emulated Amiga running Workbench 1.3, the Amiga reports a disk
error trying to read the file. (That is, it's unable to read it _at
all_, even to copy it to the NIL: device. It isn't a matter of getting
the wrong data and being unable to parse the file format.)

This is because the 'sequence number' field in the OFS data block
header is supposed to be based at 1, but affs writes it based at 0.
All three locations changed by this patch were setting the sequence
number to a variable 'bidx' which was previously obtained by dividing
a file position by bsize, so bidx will naturally use 0 for the first
block. Therefore all three should add 1 to that value before writing
it into the sequence number field.

With this change, the Amiga successfully reads the file.

For data block reference: https://wiki.osdev.org/FFS_(Amiga)

Signed-off-by: Simon Tatham &lt;anakin@pobox.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>affs: initialize fsdata in affs_truncate()</title>
<updated>2023-02-01T07:34:08+00:00</updated>
<author>
<name>Alexander Potapenko</name>
<email>glider@google.com</email>
</author>
<published>2023-01-10T12:49:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=964f121334cde6c33a9d071f9360f4d41ef56252'/>
<id>urn:sha1:964f121334cde6c33a9d071f9360f4d41ef56252</id>
<content type='text'>
[ Upstream commit eef034ac6690118c88f357b00e2b3239c9d8575d ]

When aops-&gt;write_begin() does not initialize fsdata, KMSAN may report
an error passing the latter to aops-&gt;write_end().

Fix this by unconditionally initializing fsdata.

Fixes: f2b6a16eb8f5 ("fs: affs convert to new aops")
Suggested-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
Signed-off-by: Alexander Potapenko &lt;glider@google.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>affs: move from strlcpy with unused retval to strscpy</title>
<updated>2022-08-19T11:03:10+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-08-18T21:01:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=505ffcc852401aaac4dfb57c16bec0f7838c0e00'/>
<id>urn:sha1:505ffcc852401aaac4dfb57c16bec0f7838c0e00</id>
<content type='text'>
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>affs: use memcpy_to_page and remove replace kmap_atomic()</title>
<updated>2022-08-01T17:53:31+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2022-07-12T21:30:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5abbb7b92820cf6ba9154a35cff6d64b62d7f273'/>
<id>urn:sha1:5abbb7b92820cf6ba9154a35cff6d64b62d7f273</id>
<content type='text'>
The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible. For kmap around a memcpy there's a convenience
helper memcpy_to_page that also makes the flush_dcache_page() redundant.

CC: Fabio M. De Francesco &lt;fmdefrancesco@gmail.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>affs: Convert affs to read_folio</title>
<updated>2022-05-09T20:21:44+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-04-29T15:12:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1b6f3c8731e9550317a66117a197572c86b0e1c3'/>
<id>urn:sha1:1b6f3c8731e9550317a66117a197572c86b0e1c3</id>
<content type='text'>
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>fs: Convert block_read_full_page() to block_read_full_folio()</title>
<updated>2022-05-09T20:21:44+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-04-29T14:40:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c69e2057962b6bd76d72446453862eb59325b49'/>
<id>urn:sha1:2c69e2057962b6bd76d72446453862eb59325b49</id>
<content type='text'>
This function is NOT converted to handle large folios, so include
an assert that the filesystem isn't passing one in.  Otherwise, use
the folio functions instead of the page functions, where they exist.
Convert all filesystems which use block_read_full_page().

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>fs: Remove flags parameter from aops-&gt;write_begin</title>
<updated>2022-05-08T18:28:19+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-22T19:31:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9d6b0cd7579844761ed68926eb3073bab1dca87b'/>
<id>urn:sha1:9d6b0cd7579844761ed68926eb3073bab1dca87b</id>
<content type='text'>
There are no more aop flags left, so remove the parameter.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>fs: Remove aop flags parameter from grab_cache_page_write_begin()</title>
<updated>2022-05-08T18:28:19+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-22T16:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7446e7cf15f0926866c8e5de90ab278998bf8c8'/>
<id>urn:sha1:b7446e7cf15f0926866c8e5de90ab278998bf8c8</id>
<content type='text'>
There are no more aop flags left, so remove the parameter.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>fs: Remove aop flags parameter from cont_write_begin()</title>
<updated>2022-05-08T18:28:19+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-22T16:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be3bbbc588118bdc10e21fdd7bfa6ee6b8c2555d'/>
<id>urn:sha1:be3bbbc588118bdc10e21fdd7bfa6ee6b8c2555d</id>
<content type='text'>
There are no more aop flags left, so remove the parameter.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
