<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fuse, branch v4.0</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=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-19T14:29:22Z</updated>
<entry>
<title>fuse: explicitly set /dev/fuse file's private_data</title>
<updated>2015-03-19T14:29:22Z</updated>
<author>
<name>Tom Van Braeckel</name>
<email>tomvanbraeckel@gmail.com</email>
</author>
<published>2015-01-12T04:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94e4fe2cab3d43b3ba7c3f721743006a8c9d913a'/>
<id>urn:sha1:94e4fe2cab3d43b3ba7c3f721743006a8c9d913a</id>
<content type='text'>
The misc subsystem (which is used for /dev/fuse) initializes private_data to
point to the misc device when a driver has registered a custom open file
operation, and initializes it to NULL when a custom open file operation has
*not* been provided.

This subtle quirk is confusing, to the point where kernel code registers
*empty* file open operations to have private_data point to the misc device
structure. And it leads to bugs, where the addition or removal of a custom open
file operation surprisingly changes the initial contents of a file's
private_data structure.

So to simplify things in the misc subsystem, a patch [1] has been proposed to
*always* set the private_data to point to the misc device, instead of only
doing this when a custom open file operation has been registered.

But before this patch can be applied we need to modify drivers that make the
assumption that a misc device file's private_data is initialized to NULL
because they didn't register a custom open file operation, so they don't rely
on this assumption anymore. FUSE uses private_data to store the fuse_conn and
errors out if this is not initialized to NULL at mount time.

Hence, we now set a file's private_data to NULL explicitly, to be independent
of whatever value the misc subsystem initializes it to by default.

[1] https://lkml.org/lkml/2014/12/4/939

Reported-by: Giedrius Statkevicius &lt;giedriuswork@gmail.com&gt;
Reported-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Tom Van Braeckel &lt;tomvanbraeckel@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: set stolen page uptodate</title>
<updated>2015-02-26T10:45:47Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-02-26T10:45:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa991b3b267e24f578bac7b09cc57579b660304b'/>
<id>urn:sha1:aa991b3b267e24f578bac7b09cc57579b660304b</id>
<content type='text'>
Regular pipe buffers' -&gt;steal method (generic_pipe_buf_steal()) doesn't set
PG_uptodate.

Don't warn on this condition, just set the uptodate flag.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>fuse: notify: don't move pages</title>
<updated>2015-02-26T10:45:47Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-02-26T10:45:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d2783626a53d4c922f82d51fa675cb5d13f0d36'/>
<id>urn:sha1:0d2783626a53d4c922f82d51fa675cb5d13f0d36</id>
<content type='text'>
fuse_try_move_page() is not prepared for replacing pages that have already
been read.

Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry-&gt;d_inode) to d_is_*(dentry)</title>
<updated>2015-02-22T16:38:41Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2015-01-29T12:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e36cb0b89ce20b4f8786a57e8a6bc8476f577650'/>
<id>urn:sha1:e36cb0b89ce20b4f8786a57e8a6bc8476f577650</id>
<content type='text'>
Convert the following where appropriate:

 (1) S_ISLNK(dentry-&gt;d_inode) to d_is_symlink(dentry).

 (2) S_ISREG(dentry-&gt;d_inode) to d_is_reg(dentry).

 (3) S_ISDIR(dentry-&gt;d_inode) to d_is_dir(dentry).  This is actually more
     complicated than it appears as some calls should be converted to
     d_can_lookup() instead.  The difference is whether the directory in
     question is a real dir with a -&gt;lookup op or whether it's a fake dir with
     a -&gt;d_automount op.

In some circumstances, we can subsume checks for dentry-&gt;d_inode not being
NULL into this, provided we the code isn't in a filesystem that expects
d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
use d_inode() rather than d_backing_inode() to get the inode pointer).

Note that the dentry type field may be set to something other than
DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
manages the fall-through from a negative dentry to a lower layer.  In such a
case, the dentry type of the negative union dentry is set to the same as the
type of the lower dentry.

However, if you know d_inode is not NULL at the call site, then you can use
the d_is_xxx() functions even in a filesystem.

There is one further complication: a 0,0 chardev dentry may be labelled
DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE.  Strictly, this was
intended for special directory entry types that don't have attached inodes.

The following perl+coccinelle script was used:

use strict;

my @callers;
open($fd, 'git grep -l \'S_IS[A-Z].*-&gt;d_inode\' |') ||
    die "Can't grep for S_ISDIR and co. callers";
@callers = &lt;$fd&gt;;
close($fd);
unless (@callers) {
    print "No matches\n";
    exit(0);
}

my @cocci = (
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISLNK(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_symlink(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISDIR(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_dir(E)',
    '',
    '@@',
    'expression E;',
    '@@',
    '',
    '- S_ISREG(E-&gt;d_inode-&gt;i_mode)',
    '+ d_is_reg(E)' );

my $coccifile = "tmp.sp.cocci";
open($fd, "&gt;$coccifile") || die $coccifile;
print($fd "$_\n") || die $coccifile foreach (@cocci);
close($fd);

foreach my $file (@callers) {
    chomp $file;
    print "Processing ", $file, "\n";
    system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
	die "spatch failed";
}

[AV: overlayfs parts skipped]

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.20/bdi' of git://git.kernel.dk/linux-block</title>
<updated>2015-02-12T21:50:21Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-02-12T21:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6bec0035286119eefc32a5b1102127e6a4032cb2'/>
<id>urn:sha1:6bec0035286119eefc32a5b1102127e6a4032cb2</id>
<content type='text'>
Pull backing device changes from Jens Axboe:
 "This contains a cleanup of how the backing device is handled, in
  preparation for a rework of the life time rules.  In this part, the
  most important change is to split the unrelated nommu mmap flags from
  it, but also removing a backing_dev_info pointer from the
  address_space (and inode), and a cleanup of other various minor bits.

  Christoph did all the work here, I just fixed an oops with pages that
  have a swap backing.  Arnd fixed a missing export, and Oleg killed the
  lustre backing_dev_info from staging.  Last patch was from Al,
  unexporting parts that are now no longer needed outside"

* 'for-3.20/bdi' of git://git.kernel.dk/linux-block:
  Make super_blocks and sb_lock static
  mtd: export new mtd_mmap_capabilities
  fs: make inode_to_bdi() handle NULL inode
  staging/lustre/llite: get rid of backing_dev_info
  fs: remove default_backing_dev_info
  fs: don't reassign dirty inodes to default_backing_dev_info
  nfs: don't call bdi_unregister
  ceph: remove call to bdi_unregister
  fs: remove mapping-&gt;backing_dev_info
  fs: export inode_to_bdi and use it in favor of mapping-&gt;backing_dev_info
  nilfs2: set up s_bdi like the generic mount_bdev code
  block_dev: get bdev inode bdi directly from the block device
  block_dev: only write bdev inode on close
  fs: introduce f_op-&gt;mmap_capabilities for nommu mmap support
  fs: kill BDI_CAP_SWAP_BACKED
  fs: deduplicate noop_backing_dev_info
</content>
</entry>
<entry>
<title>mm: drop vm_ops-&gt;remap_pages and generic_file_remap_pages() stub</title>
<updated>2015-02-10T22:30:30Z</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-02-10T22:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d83a08db5ba6072caa658745881f4baa9bad6a08'/>
<id>urn:sha1:d83a08db5ba6072caa658745881f4baa9bad6a08</id>
<content type='text'>
Nobody uses it anymore.

[akpm@linux-foundation.org: fix filemap_xip.c]
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Wu Fengguang &lt;fengguang.wu@intel.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>fs: remove mapping-&gt;backing_dev_info</title>
<updated>2015-01-20T21:03:05Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-01-14T09:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b83ae6d421435c6204150300f1c25bfbd39cd62b'/>
<id>urn:sha1:b83ae6d421435c6204150300f1c25bfbd39cd62b</id>
<content type='text'>
Now that we never use the backing_dev_info pointer in struct address_space
we can simply remove it and save 4 to 8 bytes in every inode.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>fs: export inode_to_bdi and use it in favor of mapping-&gt;backing_dev_info</title>
<updated>2015-01-20T21:03:04Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-01-14T09:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=de1414a654e66b81b5348dbc5259ecf2fb61655e'/>
<id>urn:sha1:de1414a654e66b81b5348dbc5259ecf2fb61655e</id>
<content type='text'>
Now that we got rid of the bdi abuse on character devices we can always use
sb-&gt;s_bdi to get at the backing_dev_info for a file, except for the block
device special case.  Export inode_to_bdi and replace uses of
mapping-&gt;backing_dev_info with it to prepare for the removal of
mapping-&gt;backing_dev_info.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>fuse: add memory barrier to INIT</title>
<updated>2015-01-06T09:45:35Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-01-06T09:45:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9759bd51899458af4f4bcc11046f01285642ca10'/>
<id>urn:sha1:9759bd51899458af4f4bcc11046f01285642ca10</id>
<content type='text'>
Theoretically we need to order setting of various fields in fc with
fc-&gt;initialized.

No known bug reports related to this yet.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: fix LOOKUP vs INIT compat handling</title>
<updated>2015-01-06T09:45:35Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-01-06T09:45:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21f621741a770c119e7529a3f5c0e6b7c91383a3'/>
<id>urn:sha1:21f621741a770c119e7529a3f5c0e6b7c91383a3</id>
<content type='text'>
Analysis from Marc:

 "Commit 7078187a795f ("fuse: introduce fuse_simple_request() helper")
  from the above pull request triggers some EIO errors for me in some tests
  that rely on fuse

  Looking at the code changes and a bit of debugging info I think there's a
  general problem here that fuse_get_req checks and possibly waits for
  fc-&gt;initialized, and this was always called first.  But this commit
  changes the ordering and in many places fc-&gt;minor is now possibly used
  before fuse_get_req, and we can't be sure that fc has been initialized.
  In my case fuse_lookup_init sets req-&gt;out.args[0].size to the wrong size
  because fc-&gt;minor at that point is still 0, leading to the EIO error."

Fix by moving the compat adjustments into fuse_simple_request() to after
fuse_get_req().

This is also more readable than the original, since now compatibility is
handled in a single function instead of cluttering each operation.

Reported-by: Marc Dionne &lt;marc.c.dionne@gmail.com&gt;
Tested-by: Marc Dionne &lt;marc.c.dionne@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Fixes: 7078187a795f ("fuse: introduce fuse_simple_request() helper")
</content>
</entry>
</feed>
