<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fuse/dev.c, branch v3.8</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.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-01-17T12:09:59Z</updated>
<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>
<entry>
<title>make get_file() return its argument</title>
<updated>2012-09-27T01:10:25Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-08-27T18:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb0942b81249798e15c3f04eee2946ef543e8115'/>
<id>urn:sha1:cb0942b81249798e15c3f04eee2946ef543e8115</id>
<content type='text'>
simplifies a bunch of callers...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fuse: fix retrieve length</title>
<updated>2012-09-04T16:45:54Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2012-09-04T16:45:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9e67d483776d8d2a5f3f70491161b205930ffe1'/>
<id>urn:sha1:c9e67d483776d8d2a5f3f70491161b205930ffe1</id>
<content type='text'>
In some cases fuse_retrieve() would return a short byte count if offset was
non-zero.  The data returned was correct, though.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>fuse: remove the second argument of k[un]map_atomic()</title>
<updated>2012-03-20T13:48:22Z</updated>
<author>
<name>Cong Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-11-25T15:14:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2408f6ef6bf58620f8330b37181d2bdca2e7c7c5'/>
<id>urn:sha1:2408f6ef6bf58620f8330b37181d2bdca2e7c7c5</id>
<content type='text'>
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
</content>
</entry>
<entry>
<title>FUSE: Notifying the kernel of deletion.</title>
<updated>2011-12-13T10:58:49Z</updated>
<author>
<name>John Muir</name>
<email>john@jmuir.com</email>
</author>
<published>2011-12-06T20:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=451d0f599934fd97faf54a5d7954b518e66192cb'/>
<id>urn:sha1:451d0f599934fd97faf54a5d7954b518e66192cb</id>
<content type='text'>
Allows a FUSE file-system to tell the kernel when a file or directory is
deleted. If the specified dentry has the specified inode number, the kernel will
unhash it.

The current 'fuse_notify_inval_entry' does not cause the kernel to clean up
directories that are in use properly, and as a result the users of those
directories see incorrect semantics from the file-system. The error condition
seen when 'fuse_notify_inval_entry' is used to notify of a deleted directory is
avoided when 'fuse_notify_delete' is used instead.

The following scenario demonstrates the difference:
1. User A chdirs into 'testdir' and starts reading 'testfile'.
2. User B rm -rf 'testdir'.
3. User B creates 'testdir'.
4. User C chdirs into 'testdir'.

If you run the above within the same machine on any file-system (including fuse
file-systems), there is no problem: user C is able to chdir into the new
testdir. The old testdir is removed from the dentry tree, but still open by user
A.

If operations 2 and 3 are performed via the network such that the fuse
file-system uses one of the notify functions to tell the kernel that the nodes
are gone, then the following error occurs for user C while user A holds the
original directory open:

muirj@empacher:~&gt; ls /test/testdir
ls: cannot access /test/testdir: No such file or directory

The issue here is that the kernel still has a dentry for testdir, and so it is
requesting the attributes for the old directory, while the file-system is
responding that the directory no longer exists.

If on the other hand, if the file-system can notify the kernel that the
directory is deleted using the new 'fuse_notify_delete' function, then the above
ls will find the new directory as expected.

Signed-off-by: John Muir &lt;john@jmuir.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: fix fuse_retrieve</title>
<updated>2011-12-13T09:36:59Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-12-13T09:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48706d0a91583d08c56e7ef2a7602d99c8d4133f'/>
<id>urn:sha1:48706d0a91583d08c56e7ef2a7602d99c8d4133f</id>
<content type='text'>
Fix two bugs in fuse_retrieve():

 - retrieving more than one page would yield repeated instances of the
   first page

 - if more than FUSE_MAX_PAGES_PER_REQ pages were requested than the
   request page array would overflow

fuse_retrieve() was added in 2.6.36 and these bugs had been there since the
beginning.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
CC: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>fuse: fix memory leak</title>
<updated>2011-09-12T18:47:10Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-09-12T07:38:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5dfcc87fd79dfb96ed155b524337dbd0da4f5993'/>
<id>urn:sha1:5dfcc87fd79dfb96ed155b524337dbd0da4f5993</id>
<content type='text'>
kmemleak is reporting that 32 bytes are being leaked by FUSE:

  unreferenced object 0xe373b270 (size 32):
  comm "fusermount", pid 1207, jiffies 4294707026 (age 2675.187s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;b05517d7&gt;] kmemleak_alloc+0x27/0x50
    [&lt;b0196435&gt;] kmem_cache_alloc+0xc5/0x180
    [&lt;b02455be&gt;] fuse_alloc_forget+0x1e/0x20
    [&lt;b0245670&gt;] fuse_alloc_inode+0xb0/0xd0
    [&lt;b01b1a8c&gt;] alloc_inode+0x1c/0x80
    [&lt;b01b290f&gt;] iget5_locked+0x8f/0x1a0
    [&lt;b0246022&gt;] fuse_iget+0x72/0x1a0
    [&lt;b02461da&gt;] fuse_get_root_inode+0x8a/0x90
    [&lt;b02465cf&gt;] fuse_fill_super+0x3ef/0x590
    [&lt;b019e56f&gt;] mount_nodev+0x3f/0x90
    [&lt;b0244e95&gt;] fuse_mount+0x15/0x20
    [&lt;b019d1bc&gt;] mount_fs+0x1c/0xc0
    [&lt;b01b5811&gt;] vfs_kern_mount+0x41/0x90
    [&lt;b01b5af9&gt;] do_kern_mount+0x39/0xd0
    [&lt;b01b7585&gt;] do_mount+0x2e5/0x660
    [&lt;b01b7966&gt;] sys_mount+0x66/0xa0

This leak report is consistent and happens once per boot on
3.1.0-rc5-dirty.

This happens if a FORGET request is queued after the fuse device was
released.

Reported-by: Sitsofe Wheeler &lt;sitsofe@yahoo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Sitsofe Wheeler &lt;sitsofe@yahoo.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message</title>
<updated>2011-08-24T08:20:17Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-08-24T08:20:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae'/>
<id>urn:sha1:c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae</id>
<content type='text'>
FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
message processing could overrun and result in a "kernel BUG at
fs/fuse/dev.c:629!"

Reported-by: Han-Wen Nienhuys &lt;hanwenn@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
CC: stable@kernel.org
</content>
</entry>
<entry>
<title>mm: add replace_page_cache_page() function</title>
<updated>2011-03-23T00:44:02Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-03-22T23:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef6a3c63112e865d632ff7c478ba7c7160cad0d1'/>
<id>urn:sha1:ef6a3c63112e865d632ff7c478ba7c7160cad0d1</id>
<content type='text'>
This function basically does:

     remove_from_page_cache(old);
     page_cache_release(old);
     add_to_page_cache_locked(new);

Except it does this atomically, so there's no possibility for the "add" to
fail because of a race.

If memory cgroups are enabled, then the memory cgroup charge is also moved
from the old page to the new.

This function is currently used by fuse to move pages into the page cache
on read, instead of copying the page contents.

[minchan.kim@gmail.com: add freepage() hook to replace_page_cache_page()]
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Signed-off-by: Minchan Kim &lt;minchan.kim@gmail.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>
</feed>
