Skip to content
  • Eric Biggers's avatar
    fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() · 26c5d78c
    Eric Biggers authored
    After request_module(), nothing is stopping the module from being
    unloaded until someone takes a reference to it via try_get_module().
    
    The WARN_ONCE() in get_fs_type() is thus user-reachable, via userspace
    running 'rmmod' concurrently.
    
    Since WARN_ONCE() is for kernel bugs only, not for user-reachable
    situations, downgrade this warning to pr_warn_once().
    
    Keep it printed once only, since the intent of this warning is to detect
    a bug in modprobe at boot time.  Printing the warning more than once
    wouldn't really provide any useful extra information.
    
    Fixes: 41124db8
    
     ("fs: warn in case userspace lied about modprobe return")
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Reviewed-by: default avatarJessica Yu <jeyu@kernel.org>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Jeff Vander Stoep <jeffv@google.com>
    Cc: Jessica Yu <jeyu@kernel.org...
    26c5d78c