<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ufs, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-02-27T19:00:17Z</updated>
<entry>
<title>Change inode_operations.mkdir to return struct dentry *</title>
<updated>2025-02-27T19:00:17Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-02-27T01:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88d5baf69082e5b410296435008329676b687549'/>
<id>urn:sha1:88d5baf69082e5b410296435008329676b687549</id>
<content type='text'>
Some filesystems, such as NFS, cifs, ceph, and fuse, do not have
complete control of sequencing on the actual filesystem (e.g.  on a
different server) and may find that the inode created for a mkdir
request already exists in the icache and dcache by the time the mkdir
request returns.  For example, if the filesystem is mounted twice the
directory could be visible on the other mount before it is on the
original mount, and a pair of name_to_handle_at(), open_by_handle_at()
calls could instantiate the directory inode with an IS_ROOT() dentry
before the first mkdir returns.

This means that the dentry passed to -&gt;mkdir() may not be the one that
is associated with the inode after the -&gt;mkdir() completes.  Some
callers need to interact with the inode after the -&gt;mkdir completes and
they currently need to perform a lookup in the (rare) case that the
dentry is no longer hashed.

This lookup-after-mkdir requires that the directory remains locked to
avoid races.  Planned future patches to lock the dentry rather than the
directory will mean that this lookup cannot be performed atomically with
the mkdir.

To remove this barrier, this patch changes -&gt;mkdir to return the
resulting dentry if it is different from the one passed in.
Possible returns are:
  NULL - the directory was created and no other dentry was used
  ERR_PTR() - an error occurred
  non-NULL - this other dentry was spliced in

This patch only changes file-systems to return "ERR_PTR(err)" instead of
"err" or equivalent transformations.  Subsequent patches will make
further changes to some file-systems to return a correct dentry.

Not all filesystems reliably result in a positive hashed dentry:

- NFS, cifs, hostfs will sometimes need to perform a lookup of
  the name to get inode information.  Races could result in this
  returning something different. Note that this lookup is
  non-atomic which is what we are trying to avoid.  Placing the
  lookup in filesystem code means it only happens when the filesystem
  has no other option.
- kernfs and tracefs leave the dentry negative and the -&gt;revalidate
  operation ensures that lookup will be called to correctly populate
  the dentry.  This could be fixed but I don't think it is important
  to any of the users of vfs_mkdir() which look at the dentry.

The recommendation to use
    d_drop();d_splice_alias()
is ugly but fits with current practice.  A planned future patch will
change this.

Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Link: https://lore.kernel.org/r/20250227013949.536172-2-neilb@suse.de
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ufs: ufs_sb_private_info: remove unused s_{2,3}apb fields</title>
<updated>2024-11-13T00:02:12Z</updated>
<author>
<name>Agathe Porte</name>
</author>
<published>2024-11-12T12:18:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6cfe56fbad32c8c5b50e82d9109413566d691569'/>
<id>urn:sha1:6cfe56fbad32c8c5b50e82d9109413566d691569</id>
<content type='text'>
These two fields are populated and stored as a "frequently used value"
in ufs_fill_super, but are not used afterwards in the driver.

Moreover, one of the shifts triggers UBSAN: shift-out-of-bounds when
apbshift is 12 because 12 * 3 = 36 and 1 &lt;&lt; 36 does not fit in the 32
bit integer used to store the value.

Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2087853
Signed-off-by: Agathe Porte &lt;agathe.porte@canonical.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: Convert ufs_change_blocknr() to take a folio</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-10-05T18:02:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b57c010e70ff11cce7f6b702d2e3bba1d893580b'/>
<id>urn:sha1:b57c010e70ff11cce7f6b702d2e3bba1d893580b</id>
<content type='text'>
Now that ufs_new_fragments() has a folio, pass it to ufs_change_blocknr()
as a folio instead of converting it from folio to page to folio.
This removes the last use of struct page in UFS.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: Pass a folio to ufs_new_fragments()</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-10-05T18:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14bcb7bb68094f3a8bb7dd8a6a87db910b596f19'/>
<id>urn:sha1:14bcb7bb68094f3a8bb7dd8a6a87db910b596f19</id>
<content type='text'>
All callers now have a folio, pass it to ufs_new_fragments() instead
of converting back to a page.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: Convert ufs_inode_getfrag() to take a folio</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-10-05T18:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24a87a0adb2febe62b6cf3e0932a23d99931906f'/>
<id>urn:sha1:24a87a0adb2febe62b6cf3e0932a23d99931906f</id>
<content type='text'>
Pass bh-&gt;b_folio instead of bh-&gt;b_page.  They're in a union, so no
code change expected.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: Convert ufs_extend_tail() to take a folio</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-10-05T18:02:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6250a013d62d100416d4953ae0fcfe8997a8ad4'/>
<id>urn:sha1:b6250a013d62d100416d4953ae0fcfe8997a8ad4</id>
<content type='text'>
Pass bh-&gt;b_folio instead of bh-&gt;b_page.  They're in a union, so no
code change expected.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: Convert ufs_inode_getblock() to take a folio</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-10-05T18:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9036c488c6ed503e0c251236abae2b7ed679847'/>
<id>urn:sha1:d9036c488c6ed503e0c251236abae2b7ed679847</id>
<content type='text'>
Pass bh-&gt;b_folio instead of bh-&gt;b_page.  They're in a union, so no
code change expected.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: take the handling of free block counters into a helper</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-12-13T19:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b103cc0ba58c680ab4e59dfa2fca4ceedfb5495'/>
<id>urn:sha1:6b103cc0ba58c680ab4e59dfa2fca4ceedfb5495</id>
<content type='text'>
There are 3 places where those counters (many and varied...) are
adjusted - when we are freeing fragments and get an entire block
freed, when we are freeing blocks and (in opposite direction) when
we are grabbing a block.  The logics is identical (modulo the
sign of adjustment) in all three; better take it into a helper -
less duplication and less clutter in the callers that way.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clean ufs_trunc_direct() up a bit...</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-03-13T16:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64f30e80d653c4d5aa0a7f1390789348af0cf8f2'/>
<id>urn:sha1:64f30e80d653c4d5aa0a7f1390789348af0cf8f2</id>
<content type='text'>
For short files (== no indirect blocks needed) UFS allows the last
block to be a partial one.  That creates some complications for
truncation down to "short file" lengths.  ufs_trunc_direct() is
called when we'd already made sure that new EOF is not in a hole;
nothing needs to be done if we are extending the file and in
case we are shrinking the file it needs to
	* shrink or free the old final block.
	* free all full direct blocks between the new and old EOF.
	* possibly shrink the new final block.

The logics is needlessly complicated by trying to keep all cases
handled by the same sequence of operations.
	if not shrinking
		nothing to do
	else if number of full blocks unchanged
		free the tail of possibly partial last block
	else
		free the tail of (currently full) new last block
		free all present (full) blocks in between
		free the (possibly partial) old last block

is easier to follow than the result of trying to unify these
cases.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ufs: get rid of ubh_{ubhcpymem,memcpyubh}()</title>
<updated>2024-10-18T21:35:31Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-03-11T01:44:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db57044217d609d1d60854e958e28f5d3684d5bc'/>
<id>urn:sha1:db57044217d609d1d60854e958e28f5d3684d5bc</id>
<content type='text'>
used only in ufs_read_cylinder_structures()/ufs_put_super_internal()
and there we can just as well avoid bothering with ufs_buffer_head
and just deal with it fragment-by-fragment.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
