fs: clean up mount_setattr control flow
authorChristian Brauner <brauner@kernel.org>
Thu, 3 Feb 2022 13:14:11 +0000 (14:14 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 14 Feb 2022 07:37:40 +0000 (08:37 +0100)
commit87bb5b60019c60e1f902e6885734cc4e5135c2d9
tree0617901debd5f10e521856457ceb6e943a6a9d4a
parentad1844a0127af8fbb87d3d7019907260daf6466b
fs: clean up mount_setattr control flow

Simplify the control flow of mount_setattr_{prepare,commit} so they
become easier to follow. We kept using both an integer error variable
that was passed by pointer as well as a pointer as an indicator for
whether or not we need to revert or commit the prepared changes.
Simplify this and just use the pointer. If we successfully changed
properties the revert pointer will be NULL and if we failed to change
properties it will indicate where we failed and thus need to stop
reverting.

Link: https://lore.kernel.org/r/20220203131411.3093040-8-brauner@kernel.org
Cc: Seth Forshee <seth.forshee@digitalocean.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c