<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/hostfs/hostfs_user.c, branch docs-6.10</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.10</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.10'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2023-06-12T19:26:19+00:00</updated>
<entry>
<title>hostfs: Fix ephemeral inodes</title>
<updated>2023-06-12T19:26:19+00:00</updated>
<author>
<name>Mickaël Salaün</name>
<email>mic@digikod.net</email>
</author>
<published>2023-06-12T19:14:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=74ce793bcbde5cef0f82d6ccb3c47cb651295a9a'/>
<id>urn:sha1:74ce793bcbde5cef0f82d6ccb3c47cb651295a9a</id>
<content type='text'>
hostfs creates a new inode for each opened or created file, which
created useless inode allocations and forbade identifying a host file
with a kernel inode.

Fix this uncommon filesystem behavior by tying kernel inodes to host
file's inode and device IDs.  Even if the host filesystem inodes may be
recycled, this cannot happen while a file referencing it is opened,
which is the case with hostfs.  It should be noted that hostfs inode IDs
may not be unique for the same hostfs superblock because multiple host's
(backed) superblocks may be used.

Delete inodes when dropping them to force backed host's file descriptors
closing.

This enables to entirely remove ARCH_EPHEMERAL_INODES, and then makes
Landlock fully supported by UML.  This is very useful for testing
changes.

These changes also factor out and simplify some helpers thanks to the
new hostfs_inode_update() and the hostfs_iget() revamp: read_name(),
hostfs_create(), hostfs_lookup(), hostfs_mknod(), and
hostfs_fill_sb_common().

A following commit with new Landlock tests check this new hostfs inode
consistency.

Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Acked-by: Richard Weinberger &lt;richard@nod.at&gt;
Link: https://lore.kernel.org/r/20230612191430.339153-2-mic@digikod.net
Signed-off-by: Mickaël Salaün &lt;mic@digikod.net&gt;
</content>
</entry>
<entry>
<title>hostfs: rename do_rmdir() to hostfs_do_rmdir()</title>
<updated>2018-04-02T18:15:53+00:00</updated>
<author>
<name>Dominik Brodowski</name>
<email>linux@dominikbrodowski.net</email>
</author>
<published>2018-03-11T10:34:48+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6380161ce9d08320d2e09f0fc64b778da433b451'/>
<id>urn:sha1:6380161ce9d08320d2e09f0fc64b778da433b451</id>
<content type='text'>
do_rmdir() is used in the VFS layer at fs/namei.c, so use a different
name in hostfs.

Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: user-mode-linux-devel@lists.sourceforge.net
Acked-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
</content>
</entry>
<entry>
<title>um: hostfs: Reduce number of syscalls in readdir</title>
<updated>2015-04-13T19:01:07+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2015-03-24T14:47:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0c9bd6365d0b278728359843b8303047ddedb831'/>
<id>urn:sha1:0c9bd6365d0b278728359843b8303047ddedb831</id>
<content type='text'>
Currently hostfs issues every time a seekdir(), in fact
it has to do this only upon the first call.
Also telldir() can be omitted as we can obtain the directory
offset from readdir().

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>hostfs: No need to box and later unbox the file mode</title>
<updated>2015-03-26T22:27:53+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2015-03-04T22:44:54+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b98b91029cf8a6defc6311d4018c44f3b05fbec7'/>
<id>urn:sha1:b98b91029cf8a6defc6311d4018c44f3b05fbec7</id>
<content type='text'>
There is really no point in having a function with 10
arguments.

Reported-by: Daniel Walter &lt;d.walter@0x90.at&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>hostfs: support rename flags</title>
<updated>2014-08-07T18:40:09+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-07-23T13:15:35+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9a423bb6e3577bb372942edfb5d9d26632741d43'/>
<id>urn:sha1:9a423bb6e3577bb372942edfb5d9d26632741d43</id>
<content type='text'>
Support RENAME_NOREPLACE and RENAME_EXCHANGE flags on hostfs if the
underlying filesystem supports it.

Since renameat2(2) is not yet in any libc, use syscall(2) to invoke the
renameat2 syscall.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>um: get rid of pointless include "..." where include &lt;...&gt; will do</title>
<updated>2012-10-09T20:28:45+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2012-10-08T02:27:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=37185b33240870719b6b5913a46e6a441f1ae96f'/>
<id>urn:sha1:37185b33240870719b6b5913a46e6a441f1ae96f</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>uml/hostfs: Propagate dirent.d_type to filldir()</title>
<updated>2012-03-24T23:29:52+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2012-01-27T18:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb'/>
<id>urn:sha1:3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb</id>
<content type='text'>
Currently the (optional) d_type member in struct dirent is always
DT_UNKNOWN on hostfs, which may confuse buggy software using readdir().
Make sure to propagate its value from the underlying filesystem if it's
available there.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: kill useless include of user.h</title>
<updated>2011-11-02T13:15:13+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ftp.linux.org.uk</email>
</author>
<published>2011-08-18T19:08:59+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=548fd1e8dba90bea674f5969d73498959d83924b'/>
<id>urn:sha1:548fd1e8dba90bea674f5969d73498959d83924b</id>
<content type='text'>
everything in USER_OBJ gets it via -include user.h

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>hostfs: code cleanups</title>
<updated>2010-10-26T23:52:12+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2010-10-26T21:22:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c5c6dd4e2dce3cb4d705d97183bc42b4e33e2606'/>
<id>urn:sha1:c5c6dd4e2dce3cb4d705d97183bc42b4e33e2606</id>
<content type='text'>
Some code cleanups for hostfs.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>hostfs: fix UML crash: remove f_spare from hostfs</title>
<updated>2010-10-26T23:52:04+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2010-10-26T21:21:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1b627d5771312c92404b66f0a0b16f66036dd2e1'/>
<id>urn:sha1:1b627d5771312c92404b66f0a0b16f66036dd2e1</id>
<content type='text'>
365b1818 ("add f_flags to struct statfs(64)") resized f_spare within
struct statfs which caused a UML crash.  There is no need to copy f_spare.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reported-by: Toralf Förster &lt;toralf.foerster@gmx.de&gt;
Tested-by: Toralf Förster &lt;toralf.foerster@gmx.de&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
