<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fuse/dev.c, branch v3.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-02-27T21:59:05Z</updated>
<entry>
<title>more file_inode() open-coded instances</title>
<updated>2013-02-27T21:59:05Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-02-27T21:59:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6131ffaa1f091415b7a24abb01f033d9c0a727f4'/>
<id>urn:sha1:6131ffaa1f091415b7a24abb01f033d9c0a727f4</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fuse: avoid out-of-scope stack access</title>
<updated>2013-02-04T14:22:23Z</updated>
<author>
<name>Eric Wong</name>
<email>normalperson@yhbt.net</email>
</author>
<published>2013-02-04T13:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a4e922c3db06f7da27e072729e047185c2fba66'/>
<id>urn:sha1:6a4e922c3db06f7da27e072729e047185c2fba66</id>
<content type='text'>
The all pointers within fuse_req must point to valid memory once
fuse_force_forget() returns.

This bug appeared in "fuse: implement NFS-like readdirplus support"
and was never in any official Linux release.

I tested the fuse_force_forget() code path by injecting to fake -ENOMEM and
verified the FORGET operation was called properly in userspace.

Signed-off-by: Eric Wong &lt;normalperson@yhbt.net&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: use req-&gt;page_descs[] for argpages cases</title>
<updated>2013-01-24T15:21:27Z</updated>
<author>
<name>Maxim Patlasov</name>
<email>mpatlasov@parallels.com</email>
</author>
<published>2012-10-26T15:49:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85f40aec887110ae6bbefa87988def4606a3d583'/>
<id>urn:sha1:85f40aec887110ae6bbefa87988def4606a3d583</id>
<content type='text'>
Previously, anyone who set flag 'argpages' only filled req-&gt;pages[] and set
per-request page_offset. This patch re-works all cases where argpages=1 to
fill req-&gt;page_descs[] properly.

Having req-&gt;page_descs[] filled properly allows to re-work fuse_copy_pages()
to copy page fragments described by req-&gt;page_descs[]. This will be useful
for next patches optimizing direct_IO.

Signed-off-by: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: add per-page descriptor &lt;offset, length&gt; to fuse_req</title>
<updated>2013-01-24T15:21:27Z</updated>
<author>
<name>Maxim Patlasov</name>
<email>mpatlasov@parallels.com</email>
</author>
<published>2012-10-26T15:49:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2430d7567a376b3685627ca7e9d712f6f27d49b'/>
<id>urn:sha1:b2430d7567a376b3685627ca7e9d712f6f27d49b</id>
<content type='text'>
The ability to save page pointers along with lengths and offsets in fuse_req
will be useful to cover several iovec-s with a single fuse_req.

Per-request page_offset is removed because anybody who need it can use
req-&gt;page_descs[0].offset instead.

Signed-off-by: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: rework fuse_retrieve()</title>
<updated>2013-01-24T15:21:26Z</updated>
<author>
<name>Maxim Patlasov</name>
<email>mpatlasov@parallels.com</email>
</author>
<published>2012-10-26T15:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d53dc99baf139e4fa0d395f7658032cc2eb3297'/>
<id>urn:sha1:4d53dc99baf139e4fa0d395f7658032cc2eb3297</id>
<content type='text'>
The patch reworks fuse_retrieve() to allocate only so many page pointers
as needed. The core part of the patch is the following calculation:

	num_pages = (num + offset + PAGE_SIZE - 1) &gt;&gt; PAGE_SHIFT;

(thanks Miklos for formula). All other changes are mostly shuffling lines.

Signed-off-by: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: categorize fuse_get_req()</title>
<updated>2013-01-24T15:21:25Z</updated>
<author>
<name>Maxim Patlasov</name>
<email>mpatlasov@parallels.com</email>
</author>
<published>2012-10-26T15:48:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b111c8c0e3e5e780ae0758fc4c1c376a7c9d5997'/>
<id>urn:sha1:b111c8c0e3e5e780ae0758fc4c1c376a7c9d5997</id>
<content type='text'>
The patch categorizes all fuse_get_req() invocations into two categories:
 - fuse_get_req_nopages(fc) - when caller doesn't care about req-&gt;pages
 - fuse_get_req(fc, n) - when caller need n page pointers (n &gt; 0)

Adding fuse_get_req_nopages() helps to avoid numerous fuse_get_req(fc, 0)
scattered over code. Now it's clear from the first glance when a caller need
fuse_req with page pointers.

The patch doesn't make any logic changes. In multi-page case, it silly
allocates array of FUSE_MAX_PAGES_PER_REQ page pointers. This will be amended
by future patches.

Signed-off-by: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: general infrastructure for pages[] of variable size</title>
<updated>2013-01-24T15:21:25Z</updated>
<author>
<name>Maxim Patlasov</name>
<email>mpatlasov@parallels.com</email>
</author>
<published>2012-10-26T15:48:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4250c0668ea10a19f3d37b1733f54ce6c8a37234'/>
<id>urn:sha1:4250c0668ea10a19f3d37b1733f54ce6c8a37234</id>
<content type='text'>
The patch removes inline array of FUSE_MAX_PAGES_PER_REQ page pointers from
fuse_req. Instead of that, req-&gt;pages may now point either to small inline
array or to an array allocated dynamically.

This essentially means that all callers of fuse_request_alloc[_nofs] should
pass the number of pages needed explicitly.

The patch doesn't make any logic changes.

Signed-off-by: Maxim Patlasov &lt;mpatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: implement NFS-like readdirplus support</title>
<updated>2013-01-24T15:21:25Z</updated>
<author>
<name>Anand V. Avati</name>
<email>avati@redhat.com</email>
</author>
<published>2012-08-19T12:53:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b05b18381eea98c9c9ada95629bf659a88c9374'/>
<id>urn:sha1:0b05b18381eea98c9c9ada95629bf659a88c9374</id>
<content type='text'>
This patch implements readdirplus support in FUSE, similar to NFS.
The payload returned in the readdirplus call contains
'fuse_entry_out' structure thereby providing all the necessary inputs
for 'faking' a lookup() operation on the spot.

If the dentry and inode already existed (for e.g. in a re-run of ls -l)
then just the inode attributes timeout and dentry timeout are refreshed.

With a simple client-&gt;network-&gt;server implementation of a FUSE based
filesystem, the following performance observations were made:

Test: Performing a filesystem crawl over 20,000 files with

sh# time ls -lR /mnt

Without readdirplus:
Run 1: 18.1s
Run 2: 16.0s
Run 3: 16.2s

With readdirplus:
Run 1: 4.1s
Run 2: 3.8s
Run 3: 3.8s

The performance improvement is significant as it avoided 20,000 upcalls
calls (lookup). Cache consistency is no worse than what already is.

Signed-off-by: Anand V. Avati &lt;avati@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: remove unused variable in fuse_try_move_page()</title>
<updated>2013-01-17T12:09:59Z</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2012-10-18T14:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f706111a860c026bcb0abe0c5936f59c31e5c87'/>
<id>urn:sha1:8f706111a860c026bcb0abe0c5936f59c31e5c87</id>
<content type='text'>
The variables mapping,index are initialized but never used
otherwise, so remove the unused variables.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>userns: Support fuse interacting with multiple user namespaces</title>
<updated>2012-11-15T06:05:33Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-02-08T00:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=499dcf2024092e5cce41d05599a5b51d1f92031a'/>
<id>urn:sha1:499dcf2024092e5cce41d05599a5b51d1f92031a</id>
<content type='text'>
Use kuid_t and kgid_t in struct fuse_conn and struct fuse_mount_data.

The connection between between a fuse filesystem and a fuse daemon is
established when a fuse filesystem is mounted and provided with a file
descriptor the fuse daemon created by opening /dev/fuse.

For now restrict the communication of uids and gids between the fuse
filesystem and the fuse daemon to the initial user namespace.  Enforce
this by verifying the file descriptor passed to the mount of fuse was
opened in the initial user namespace.  Ensuring the mount happens in
the initial user namespace is not necessary as mounts from non-initial
user namespaces are not yet allowed.

In fuse_req_init_context convert the currrent fsuid and fsgid into the
initial user namespace for the request that will be sent to the fuse
daemon.

In fuse_fill_attr convert the uid and gid passed from the fuse daemon
from the initial user namespace into kuids and kgids.

In iattr_to_fattr called from fuse_setattr convert kuids and kgids
into the uids and gids in the initial user namespace before passing
them to the fuse filesystem.

In fuse_change_attributes_common called from fuse_dentry_revalidate,
fuse_permission, fuse_geattr, and fuse_setattr, and fuse_iget convert
the uid and gid from the fuse daemon into a kuid and a kgid to store
on the fuse inode.

By default fuse mounts are restricted to task whose uid, suid, and
euid matches the fuse user_id and whose gid, sgid, and egid matches
the fuse group id.  Convert the user_id and group_id mount options
into kuids and kgids at mount time, and use uid_eq and gid_eq to
compare the in fuse_allow_task.

Cc: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
</feed>
