<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/fuse/dir.c, branch v3.17</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>fs: call rename2 if exists</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:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7177a9c4b509eb357cc450256bc3cf39f1a1e639'/>
<id>7177a9c4b509eb357cc450256bc3cf39f1a1e639</id>
<content type='text'>
Christoph Hellwig suggests:

1) make vfs_rename call -&gt;rename2 if it exists instead of -&gt;rename
2) switch all filesystems that you're adding NOREPLACE support for to
   use -&gt;rename2
3) see how many -&gt;rename instances we'll have left after a few
   iterations of 2.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Christoph Hellwig suggests:

1) make vfs_rename call -&gt;rename2 if it exists instead of -&gt;rename
2) switch all filesystems that you're adding NOREPLACE support for to
   use -&gt;rename2
3) see how many -&gt;rename instances we'll have left after a few
   iterations of 2.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: restructure -&gt;rename2()</title>
<updated>2014-07-10T08:50:19+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-07-10T08:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4237ba43b65aa989674c89fc4f2fe46eebc501ee'/>
<id>4237ba43b65aa989674c89fc4f2fe46eebc501ee</id>
<content type='text'>
Make -&gt;rename2() universal, i.e. able to handle zero flags.  This is to
make future change of the API easier.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make -&gt;rename2() universal, i.e. able to handle zero flags.  This is to
make future change of the API easier.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: ignore entry-timeout on LOOKUP_REVAL</title>
<updated>2014-07-07T13:28:51+00:00</updated>
<author>
<name>Anand Avati</name>
<email>avati@redhat.com</email>
</author>
<published>2014-06-27T00:21:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=154210ccb3a871e631bf39fdeb7a8731d98af87b'/>
<id>154210ccb3a871e631bf39fdeb7a8731d98af87b</id>
<content type='text'>
The following test case demonstrates the bug:

  sh# mount -t glusterfs localhost:meta-test /mnt/one

  sh# mount -t glusterfs localhost:meta-test /mnt/two

  sh# echo stuff &gt; /mnt/one/file; rm -f /mnt/two/file; echo stuff &gt; /mnt/one/file
  bash: /mnt/one/file: Stale file handle

  sh# echo stuff &gt; /mnt/one/file; rm -f /mnt/two/file; sleep 1; echo stuff &gt; /mnt/one/file

On the second open() on /mnt/one, FUSE would have used the old
nodeid (file handle) trying to re-open it. Gluster is returning
-ESTALE. The ESTALE propagates back to namei.c:filename_lookup()
where lookup is re-attempted with LOOKUP_REVAL. The right
behavior now, would be for FUSE to ignore the entry-timeout and
and do the up-call revalidation. Instead FUSE is ignoring
LOOKUP_REVAL, succeeding the revalidation (because entry-timeout
has not passed), and open() is again retried on the old file
handle and finally the ESTALE is going back to the application.

Fix: if revalidation is happening with LOOKUP_REVAL, then ignore
entry-timeout and always do the up-call.

Signed-off-by: Anand Avati &lt;avati@redhat.com&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following test case demonstrates the bug:

  sh# mount -t glusterfs localhost:meta-test /mnt/one

  sh# mount -t glusterfs localhost:meta-test /mnt/two

  sh# echo stuff &gt; /mnt/one/file; rm -f /mnt/two/file; echo stuff &gt; /mnt/one/file
  bash: /mnt/one/file: Stale file handle

  sh# echo stuff &gt; /mnt/one/file; rm -f /mnt/two/file; sleep 1; echo stuff &gt; /mnt/one/file

On the second open() on /mnt/one, FUSE would have used the old
nodeid (file handle) trying to re-open it. Gluster is returning
-ESTALE. The ESTALE propagates back to namei.c:filename_lookup()
where lookup is re-attempted with LOOKUP_REVAL. The right
behavior now, would be for FUSE to ignore the entry-timeout and
and do the up-call revalidation. Instead FUSE is ignoring
LOOKUP_REVAL, succeeding the revalidation (because entry-timeout
has not passed), and open() is again retried on the old file
handle and finally the ESTALE is going back to the application.

Fix: if revalidation is happening with LOOKUP_REVAL, then ignore
entry-timeout and always do the up-call.

Signed-off-by: Anand Avati &lt;avati@redhat.com&gt;
Reviewed-by: Niels de Vos &lt;ndevos@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: timeout comparison fix</title>
<updated>2014-07-07T13:28:50+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-07-07T13:28:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=126b9d4365b110c157bc4cbc32540dfa66c9c85a'/>
<id>126b9d4365b110c157bc4cbc32540dfa66c9c85a</id>
<content type='text'>
As suggested by checkpatch.pl, use time_before64() instead of direct
comparison of jiffies64 values.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As suggested by checkpatch.pl, use time_before64() instead of direct
comparison of jiffies64 values.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: add renameat2 support</title>
<updated>2014-04-28T14:43:44+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-04-28T14:43:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1560c974dcd40a8d3f193283acd7cc6aee13dc13'/>
<id>1560c974dcd40a8d3f193283acd7cc6aee13dc13</id>
<content type='text'>
Support RENAME_EXCHANGE and RENAME_NOREPLACE flags on the userspace ABI.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support RENAME_EXCHANGE and RENAME_NOREPLACE flags on the userspace ABI.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: clear FUSE_I_CTIME_DIRTY flag on setattr</title>
<updated>2014-04-28T12:19:25+00:00</updated>
<author>
<name>Maxim Patlasov</name>
<email>MPatlasov@parallels.com</email>
</author>
<published>2014-04-28T12:19:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3ad22c62dd23ad26c8737c300f455de60ba01f40'/>
<id>3ad22c62dd23ad26c8737c300f455de60ba01f40</id>
<content type='text'>
The patch addresses two use-cases when the flag may be safely cleared:

1. fuse_do_setattr() is called with ATTR_CTIME flag set in attr-&gt;ia_valid.
In this case attr-&gt;ia_ctime bears actual value. In-kernel fuse must send it
to the userspace server and then assign the value to inode-&gt;i_ctime.

2. fuse_do_setattr() is called with ATTR_SIZE flag set in attr-&gt;ia_valid,
whereas ATTR_CTIME is not set (truncate(2)).
In this case in-kernel fuse must sent "now" to the userspace server and then
assign the value to inode-&gt;i_ctime.

In both cases we could clear I_DIRTY_SYNC, but that needs more thought.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch addresses two use-cases when the flag may be safely cleared:

1. fuse_do_setattr() is called with ATTR_CTIME flag set in attr-&gt;ia_valid.
In this case attr-&gt;ia_ctime bears actual value. In-kernel fuse must send it
to the userspace server and then assign the value to inode-&gt;i_ctime.

2. fuse_do_setattr() is called with ATTR_SIZE flag set in attr-&gt;ia_valid,
whereas ATTR_CTIME is not set (truncate(2)).
In this case in-kernel fuse must sent "now" to the userspace server and then
assign the value to inode-&gt;i_ctime.

In both cases we could clear I_DIRTY_SYNC, but that needs more thought.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: trust kernel i_ctime only</title>
<updated>2014-04-28T12:19:24+00:00</updated>
<author>
<name>Maxim Patlasov</name>
<email>MPatlasov@parallels.com</email>
</author>
<published>2014-04-28T12:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=31f3267b4ba16b12fb9dd3b1953ea0f221cc2ab4'/>
<id>31f3267b4ba16b12fb9dd3b1953ea0f221cc2ab4</id>
<content type='text'>
Let the kernel maintain i_ctime locally: update i_ctime explicitly on
truncate, fallocate, open(O_TRUNC), setxattr, removexattr, link, rename,
unlink.

The inode flag I_DIRTY_SYNC serves as indication that local i_ctime should
be flushed to the server eventually.  The patch sets the flag and updates
i_ctime in course of operations listed above.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let the kernel maintain i_ctime locally: update i_ctime explicitly on
truncate, fallocate, open(O_TRUNC), setxattr, removexattr, link, rename,
unlink.

The inode flag I_DIRTY_SYNC serves as indication that local i_ctime should
be flushed to the server eventually.  The patch sets the flag and updates
i_ctime in course of operations listed above.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: remove .update_time</title>
<updated>2014-04-28T12:19:24+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-04-28T12:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8b47e73e91c064cd75e8bf458ce738e1bfe2e700'/>
<id>8b47e73e91c064cd75e8bf458ce738e1bfe2e700</id>
<content type='text'>
This implements updating ctime as well as mtime on file_update_time().

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements updating ctime as well as mtime on file_update_time().

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: allow ctime flushing to userspace</title>
<updated>2014-04-28T12:19:24+00:00</updated>
<author>
<name>Maxim Patlasov</name>
<email>MPatlasov@parallels.com</email>
</author>
<published>2014-04-28T12:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ab9e13f7c771b511d8f71666e83cb27bcc635b98'/>
<id>ab9e13f7c771b511d8f71666e83cb27bcc635b98</id>
<content type='text'>
The patch extends fuse_setattr_in, and extends the flush procedure
(fuse_flush_times()) called on -&gt;write_inode() to send the ctime as well as
mtime.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch extends fuse_setattr_in, and extends the flush procedure
(fuse_flush_times()) called on -&gt;write_inode() to send the ctime as well as
mtime.

Signed-off-by: Maxim Patlasov &lt;MPatlasov@parallels.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: add .write_inode</title>
<updated>2014-04-28T12:19:23+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2014-04-28T12:19:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1e18bda86e2dcc4ecb176213ee34649c93ad1396'/>
<id>1e18bda86e2dcc4ecb176213ee34649c93ad1396</id>
<content type='text'>
...and flush mtime from this.  This allows us to use the kernel
infrastructure for writing out dirty metadata (mtime at this point, but
ctime in the next patches and also maybe atime).

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
...and flush mtime from this.  This allows us to use the kernel
infrastructure for writing out dirty metadata (mtime at this point, but
ctime in the next patches and also maybe atime).

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</pre>
</div>
</content>
</entry>
</feed>
