Commit 26423e18 authored by Amir Goldstein's avatar Amir Goldstein Committed by Greg Kroah-Hartman
Browse files

ovl: do not encode lower fh with upper sb_writers held



[ Upstream commit 5b02bfc1 ]

When lower fs is a nested overlayfs, calling encode_fh() on a lower
directory dentry may trigger copy up and take sb_writers on the upper fs
of the lower nested overlayfs.

The lower nested overlayfs may have the same upper fs as this overlayfs,
so nested sb_writers lock is illegal.

Move all the callers that encode lower fh to before ovl_want_write().

Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Stable-dep-of: c45beebf ("ovl: support encoding fid from inode with no alias")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1e92afe8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment