From: David Sterba <dsterba@suse.cz>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Filipe Manana <fdmanana@kernel.org>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: fix fallocate to use file_modified to update permissions consistently
Date: Tue, 15 Mar 2022 20:58:52 +0100 [thread overview]
Message-ID: <20220315195852.GV12643@twin.jikos.cz> (raw)
In-Reply-To: <20220314175532.GB8165@magnolia>
On Mon, Mar 14, 2022 at 10:55:32AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Since the initial introduction of (posix) fallocate back at the turn of
> the century, it has been possible to use this syscall to change the
> user-visible contents of files. This can happen by extending the file
> size during a preallocation, or through any of the newer modes (punch,
> zero range). Because the call can be used to change file contents, we
> should treat it like we do any other modification to a file -- update
> the mtime, and drop set[ug]id privileges/capabilities.
>
> The VFS function file_modified() does all this for us if pass it a
> locked inode, so let's make fallocate drop permissions correctly.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> v2: move up file_modified to catch a case where we could modify file
> contents but fail on something else before we end up calling
> file_modified
Added to misc-next, thanks.
next prev parent reply other threads:[~2022-03-15 20:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 17:55 [PATCH v2] btrfs: fix fallocate to use file_modified to update permissions consistently Darrick J. Wong
2022-03-15 10:50 ` Filipe Manana
2022-03-15 19:58 ` David Sterba [this message]
2022-03-20 15:24 ` [btrfs] 7664aed024: fio.write_iops 29.3% improvement kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220315195852.GV12643@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=djwong@kernel.org \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox