OSDN Git Service

fs: use a for loop when locking a mount
authorChristian Brauner <brauner@kernel.org>
Wed, 3 May 2023 11:18:41 +0000 (13:18 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 May 2023 02:30:22 +0000 (04:30 +0200)
commit64f44b27ae9184e13ebbca230fa83da02a10f283
tree09cc3e55262406d7f0736a35d87432915b45c420
parent104026c2e49f39399088dfcd6abf5415b655d6fe
fs: use a for loop when locking a mount

Currently, lock_mount() uses a goto to retry the lookup until it
succeeded in acquiring the namespace_lock() preventing the top mount
from being overmounted. While that's perfectly fine we want to lookup
the mountpoint on the parent of the top mount in later patches. So adapt
the code to make this easier to implement. Also, the for loop is
arguably a little cleaner and makes the code easier to follow. No
functional changes intended.

Reviewed-by: Seth Forshee (DigitalOcean) <sforshee@kernel.org>
Message-Id: <20230202-fs-move-mount-replace-v4-3-98f3d80d7eaa@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c