• Christian Brauner's avatar
    fs: don't assume arguments are non-NULL · 33ab231f
    Christian Brauner authored
    The helper is explicitly documented as locking zero, one, or two
    arguments. While all current callers do pass non-NULL arguments there's
    no need or requirement for them to do so according to the code and the
    unlock_two_nondirectories() helper is pretty clear about it as well. So
    only call WARN_ON_ONCE() if the checked inode is valid.
    
    Fixes: 2454ad83 ("fs: Restrict lock_two_nondirectories() to non-directory inodes")
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    Cc: Jan Kara <jack@suse.cz>
    Message-Id: <20230703-vfs-rename-source-v1-2-37eebb29b65b@kernel.org>
    Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
    33ab231f
inode.c 68.6 KB