<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/read_write.c, branch v6.16</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=v6.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-05-15T10:03:12Z</updated>
<entry>
<title>fs/read_write: make default_llseek() killable</title>
<updated>2025-05-15T10:03:12Z</updated>
<author>
<name>Max Kellermann</name>
<email>max.kellermann@ionos.com</email>
</author>
<published>2025-05-13T15:03:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e1a8fbff51bb9bdf0fe9c6602855e308efcfcdb'/>
<id>urn:sha1:2e1a8fbff51bb9bdf0fe9c6602855e308efcfcdb</id>
<content type='text'>
Allows killing processes that are waiting for the inode lock.

Signed-off-by: Max Kellermann &lt;max.kellermann@ionos.com&gt;
Link: https://lore.kernel.org/20250513150327.1373061-4-max.kellermann@ionos.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: don't needlessly acquire f_lock</title>
<updated>2025-02-21T09:25:32Z</updated>
<author>
<name>Christian Brauner</name>
<email>brauner@kernel.org</email>
</author>
<published>2025-02-07T14:10:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=da06e3c5179467f9ef7caffb512ef111a70afde1'/>
<id>urn:sha1:da06e3c5179467f9ef7caffb512ef111a70afde1</id>
<content type='text'>
Before 2011 there was no meaningful synchronization between
read/readdir/write/seek. Only in commit
ef3d0fd27e90 ("vfs: do (nearly) lockless generic_file_llseek")
synchronization was added for SEEK_CUR by taking f_lock around
vfs_setpos().

Then in 2014 full synchronization between read/readdir/write/seek was
added in commit 9c225f2655e3 ("vfs: atomic f_pos accesses as per POSIX")
by introducing f_pos_lock for regular files with FMODE_ATOMIC_POS and
for directories. At that point taking f_lock became unnecessary for such
files.

So only acquire f_lock for SEEK_CUR if this isn't a file that would have
acquired f_pos_lock if necessary.

Link: https://lore.kernel.org/r/20250207-daten-mahlzeit-99d2079864fb@brauner
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pull-fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2024-11-18T20:24:06Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-18T20:24:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f25f0e4efaeb68086f7e65c442f2d648b21736f'/>
<id>urn:sha1:0f25f0e4efaeb68086f7e65c442f2d648b21736f</id>
<content type='text'>
Pull 'struct fd' class updates from Al Viro:
 "The bulk of struct fd memory safety stuff

  Making sure that struct fd instances are destroyed in the same scope
  where they'd been created, getting rid of reassignments and passing
  them by reference, converting to CLASS(fd{,_pos,_raw}).

  We are getting very close to having the memory safety of that stuff
  trivial to verify"

* tag 'pull-fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (28 commits)
  deal with the last remaing boolean uses of fd_file()
  css_set_fork(): switch to CLASS(fd_raw, ...)
  memcg_write_event_control(): switch to CLASS(fd)
  assorted variants of irqfd setup: convert to CLASS(fd)
  do_pollfd(): convert to CLASS(fd)
  convert do_select()
  convert vfs_dedupe_file_range().
  convert cifs_ioctl_copychunk()
  convert media_request_get_by_fd()
  convert spu_run(2)
  switch spufs_calls_{get,put}() to CLASS() use
  convert cachestat(2)
  convert do_preadv()/do_pwritev()
  fdget(), more trivial conversions
  fdget(), trivial conversions
  privcmd_ioeventfd_assign(): don't open-code eventfd_ctx_fdget()
  o2hb_region_dev_store(): avoid goto around fdget()/fdput()
  introduce "fd_pos" class, convert fdget_pos() users to it.
  fdget_raw() users: switch to CLASS(fd_raw)
  convert vmsplice() to CLASS(fd)
  ...
</content>
</entry>
<entry>
<title>fs: Export generic_atomic_write_valid()</title>
<updated>2024-11-05T00:14:02Z</updated>
<author>
<name>John Garry</name>
<email>john.g.garry@oracle.com</email>
</author>
<published>2024-11-05T00:14:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a570bad16b9f5252db2f342622bd71febb39a19c'/>
<id>urn:sha1:a570bad16b9f5252db2f342622bd71febb39a19c</id>
<content type='text'>
The XFS code will need this.

Reviewed-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
</content>
</entry>
<entry>
<title>convert do_preadv()/do_pwritev()</title>
<updated>2024-11-03T06:28:06Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-07-23T01:51:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=20d9eb3b870630f213adfd82d255acd36341b036'/>
<id>urn:sha1:20d9eb3b870630f213adfd82d255acd36341b036</id>
<content type='text'>
fdput() can be transposed with add_{r,w}char() and inc_sysc{r,w}();
it's the same story as with do_readv()/do_writev(), only with
fdput() instead of fdput_pos().

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fdget(), more trivial conversions</title>
<updated>2024-11-03T06:28:06Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-07-20T01:19:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8152f8201088350c76bb9685cd5990dd51d59aff'/>
<id>urn:sha1:8152f8201088350c76bb9685cd5990dd51d59aff</id>
<content type='text'>
all failure exits prior to fdget() leave the scope, all matching fdput()
are immediately followed by leaving the scope.

[xfs_ioc_commit_range() chunk moved here as well]

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fdget(), trivial conversions</title>
<updated>2024-11-03T06:28:06Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-07-20T00:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6348be02eead77bdd1562154ed6b3296ad3b3750'/>
<id>urn:sha1:6348be02eead77bdd1562154ed6b3296ad3b3750</id>
<content type='text'>
fdget() is the first thing done in scope, all matching fdput() are
immediately followed by leaving the scope.

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>introduce "fd_pos" class, convert fdget_pos() users to it.</title>
<updated>2024-11-03T06:28:06Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-06-01T02:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7a9616ce0348b9d945d5dff82e4b44c0fe75b39'/>
<id>urn:sha1:d7a9616ce0348b9d945d5dff82e4b44c0fe75b39</id>
<content type='text'>
fdget_pos() for constructor, fdput_pos() for cleanup, all users of
fd..._pos() converted trivially.

Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs/block: Check for IOCB_DIRECT in generic_atomic_write_valid()</title>
<updated>2024-10-19T22:48:22Z</updated>
<author>
<name>John Garry</name>
<email>john.g.garry@oracle.com</email>
</author>
<published>2024-10-19T12:51:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3be7ebbbce5201e151f17e28a6c807602f369c9'/>
<id>urn:sha1:c3be7ebbbce5201e151f17e28a6c807602f369c9</id>
<content type='text'>
Currently FMODE_CAN_ATOMIC_WRITE is set if the bdev can atomic write and
the file is open for direct IO. This does not work if the file is not
opened for direct IO, yet fcntl(O_DIRECT) is used on the fd later.

Change to check for direct IO on a per-IO basis in
generic_atomic_write_valid(). Since we want to report -EOPNOTSUPP for
non-direct IO for an atomic write, change to return an error code.

Relocate the block fops atomic write checks to the common write path, as to
catch non-direct IO.

Fixes: c34fc6f26ab8 ("fs: Initial atomic write support")
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://lore.kernel.org/r/20241019125113.369994-3-john.g.garry@oracle.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block/fs: Pass an iocb to generic_atomic_write_valid()</title>
<updated>2024-10-19T22:48:21Z</updated>
<author>
<name>John Garry</name>
<email>john.g.garry@oracle.com</email>
</author>
<published>2024-10-19T12:51:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9a8dbdadae509e5717ff6e5aa572ca0974d2101d'/>
<id>urn:sha1:9a8dbdadae509e5717ff6e5aa572ca0974d2101d</id>
<content type='text'>
Darrick and Hannes both thought it better that generic_atomic_write_valid()
should be passed a struct iocb, and not just the member of that struct
which is referenced; see [0] and [1].

I think that makes a more generic and clean API, so make that change.

[0] https://lore.kernel.org/linux-block/680ce641-729b-4150-b875-531a98657682@suse.de/
[1] https://lore.kernel.org/linux-xfs/20240620212401.GA3058325@frogsfrogsfrogs/

Fixes: c34fc6f26ab8 ("fs: Initial atomic write support")
Suggested-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Suggested-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://lore.kernel.org/r/20241019125113.369994-2-john.g.garry@oracle.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
