diff options
author | Christian Brauner <[email protected]> | 2022-02-03 14:14:09 +0100 |
---|---|---|
committer | Christian Brauner <[email protected]> | 2022-02-14 08:37:40 +0100 |
commit | 03b6abee9ba67c20c4e5253e1a347d8c26edc511 (patch) | |
tree | dda5e0d50bbb9c0c7cbff556c31883932cdb1f2e /net/lapb/lapb_subr.c | |
parent | a26f788b6e7a10d193c4cc6889818e4d625e9461 (diff) |
fs: simplify check in mount_setattr_commit()
In order to determine whether we need to call mnt_unhold_writers() in
mount_setattr_commit() we currently do not just check whether
MNT_WRITE_HOLD is set but also if a read-only mount was requested.
However, checking whether MNT_WRITE_HOLD is set is enough. Setting
MNT_WRITE_HOLD requires lock_mount_hash() to be held and it must be
unset before calling unlock_mount_hash(). This guarantees that if we see
MNT_WRITE_HOLD we know that we were the ones who set it earlier. We
don't need to care about why we set it. Plus, leaving this additional
read-only check in makes the code more confusing because it implies that
MNT_WRITE_HOLD could've been set by another thread when it really can't.
Remove it and update the associated comment.
Link: https://lore.kernel.org/r/[email protected]
Cc: Seth Forshee <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Al Viro <[email protected]>
Cc: [email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions