A spin lock is held before kstrndup, it may sleep with holding
the spinlock, so we should use GFP_ATOMIC instead.
Fixes: e58c31d5e387 ("cifs: Add support for failover in cifs_reconnect()")
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Steve French <[email protected]>
Reviewed-by: Paulo Alcantara <[email protected]>
tcon->remap = cifs_remap(cifs_sb);
}
cifs_sb->origin_fullpath = kstrndup(tcon->dfs_path,
- strlen(tcon->dfs_path), GFP_KERNEL);
+ strlen(tcon->dfs_path),
+ GFP_ATOMIC);
if (!cifs_sb->origin_fullpath) {
spin_unlock(&cifs_tcp_ses_lock);
rc = -ENOMEM;