1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-17 03:50:37 +00:00
Eric Biggers 14e43bf435 vfs: don't unnecessarily clone write access for writable fds
There's no need for mnt_want_write_file() to increment mnt_writers when
the file is already open for writing, provided that
mnt_drop_write_file() is changed to conditionally decrement it.

We seem to have ended up in the current situation because
mnt_want_write_file() used to be paired with mnt_drop_write(), due to
mnt_drop_write_file() not having been added yet.  So originally
mnt_want_write_file() had to always increment mnt_writers.

But later mnt_drop_write_file() was added, and all callers of
mnt_want_write_file() were paired with it.  This makes the compatibility
between mnt_want_write_file() and mnt_drop_write() no longer necessary.

Therefore, make __mnt_want_write_file() and __mnt_drop_write_file() skip
incrementing mnt_writers on files already open for writing.  This
removes the only caller of mnt_clone_write(), so remove that too.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2021-01-04 14:02:08 -05:00
..
2020-12-17 12:52:23 -08:00
2020-12-16 16:38:41 -08:00
2020-12-16 16:38:41 -08:00
2020-12-16 18:48:16 +01:00
2020-12-17 12:52:23 -08:00
2020-12-17 12:15:03 -08:00
2020-12-16 13:09:32 -08:00
2020-12-16 12:57:51 -08:00
2020-12-19 11:18:38 -08:00
2020-12-16 10:45:11 -08:00
2020-12-22 13:19:43 -08:00
2020-12-16 16:38:41 -08:00
2020-12-14 16:24:19 +01:00
2020-12-11 14:02:14 -08:00
2020-12-16 12:33:35 -08:00
2020-12-17 11:18:00 -08:00
2020-12-16 11:06:07 -08:00
2020-12-15 16:39:06 -08:00
2020-12-15 16:19:31 +01:00
2020-12-15 16:19:31 +01:00
2020-12-17 13:22:17 -08:00
2020-12-15 13:22:29 -08:00
2020-12-17 13:34:25 -08:00
2020-12-15 14:10:09 -08:00
2020-12-17 13:01:31 -08:00
2020-12-15 14:02:26 -08:00
2020-12-15 15:11:08 -06:00
2020-12-14 17:34:12 -08:00
2020-12-16 13:08:18 -08:00
2020-12-15 12:13:39 -08:00
2020-12-20 10:12:06 -08:00
2020-12-15 15:57:25 -08:00
2020-12-16 16:38:41 -08:00
2020-12-16 11:30:10 -08:00
2020-12-16 11:01:04 -08:00
2020-12-15 12:13:37 -08:00
2020-12-19 11:18:38 -08:00
2020-12-14 16:40:27 -08:00
2020-12-16 12:33:35 -08:00
2020-12-15 12:13:41 -08:00