Re: [PATCH] smb: client: refactor cifs_revalidate_mapping() to use clear_and_wake_up_bit()

Steve French <[email protected]> Sat, 4 Jul 2026 16:25:27 -0500
Newsgroups gmane.linux.kernel,gmane.linux.kernel.cifs,gmane.network.samba.internals
Message-ID <CAH2r5mvzvKo1gANZZCVAajGOQiw-wRfkW9UV9PNp_sQoVQmduQ@mail.gmail.com>
merged into cifs-2.6.git for-next

On Fri, Jul 3, 2026 at 9:35=E2=80=AFPM Mehdi Hassan <[email protected]=
> wrote:
>
> In the `skip_invalidate:` path under `cifs_revalidate_mapping()`, the
> sequence of calls:
>         clear_bit_unlock();
>         smp_mb__after_atomic();
>         wake_up_bit();
> can be replaced exactly by `clear_and_wake_up_bit()`.
>
> The `clear_and_wake_up_bit()` helper function was introduced in
> 'commit 8236b0ae31c83 ("bdi: wake up concurrent wb_shutdown()
> callers.")' to replace equivalent instances of this sequence of
> operations. This substitution has been applied in multiple subsystems.
>
> Compile-tested with CONFIG_CIFS=3Dy on x86_64, no new warnings present.
>
> Suggested-by: Agatha Isabelle Moreira <[email protected]>
> Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tas=
ks%20by%20Agatha%20Isabelle%20Moreira#task_010
> Cc: Agatha Isabelle Moreira <[email protected]>
> Signed-off-by: Mehdi Hassan <[email protected]>
> ---
>  fs/smb/client/inode.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
> index 1dbcfd163ff0..2ed1c79c1132 100644
> --- a/fs/smb/client/inode.c
> +++ b/fs/smb/client/inode.c
> @@ -2812,9 +2812,7 @@ cifs_revalidate_mapping(struct inode *inode)
>         }
>
>  skip_invalidate:
> -       clear_bit_unlock(CIFS_INO_LOCK, flags);
> -       smp_mb__after_atomic();
> -       wake_up_bit(flags, CIFS_INO_LOCK);
> +       clear_and_wake_up_bit(CIFS_INO_LOCK, flags);
>
>         return rc;
>  }
> --
> 2.54.0
>
>
>


--=20
Thanks,

Steve