mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 12:49:35 +02:00
ovl: fix encoding fid for lower only root
commit004b8d1491
upstream. ovl_check_encode_origin() should return a positive number if the lower dentry is to be encoded, zero otherwise. If there's no upper layer at all (read-only overlay), then it obviously needs to return positive. This was broken by commit16aac5ad1f
("ovl: support encoding non-decodable file handles"), which didn't take the lower-only configuration into account. Fix by checking the no-upper-layer case up-front. Reported-and-tested-by: Youzhong Yang <youzhong@gmail.com> Closes: https://lore.kernel.org/all/CADpNCvaBimi+zCYfRJHvCOhMih8OU0rmZkwLuh24MKKroRuT8Q@mail.gmail.com/ Fixes:16aac5ad1f
("ovl: support encoding non-decodable file handles") Cc: <stable@vger.kernel.org> # v6.6 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cd2f517976
commit
1025281622
|
@ -186,6 +186,10 @@ static int ovl_check_encode_origin(struct dentry *dentry)
|
||||||
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
|
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
|
||||||
bool decodable = ofs->config.nfs_export;
|
bool decodable = ofs->config.nfs_export;
|
||||||
|
|
||||||
|
/* No upper layer? */
|
||||||
|
if (!ovl_upper_mnt(ofs))
|
||||||
|
return 1;
|
||||||
|
|
||||||
/* Lower file handle for non-upper non-decodable */
|
/* Lower file handle for non-upper non-decodable */
|
||||||
if (!ovl_dentry_upper(dentry) && !decodable)
|
if (!ovl_dentry_upper(dentry) && !decodable)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -214,7 +218,7 @@ static int ovl_check_encode_origin(struct dentry *dentry)
|
||||||
* ovl_connect_layer() will try to make origin's layer "connected" by
|
* ovl_connect_layer() will try to make origin's layer "connected" by
|
||||||
* copying up a "connectable" ancestor.
|
* copying up a "connectable" ancestor.
|
||||||
*/
|
*/
|
||||||
if (d_is_dir(dentry) && ovl_upper_mnt(ofs) && decodable)
|
if (d_is_dir(dentry) && decodable)
|
||||||
return ovl_connect_layer(dentry);
|
return ovl_connect_layer(dentry);
|
||||||
|
|
||||||
/* Lower file handle for indexed and non-upper dir/non-dir */
|
/* Lower file handle for indexed and non-upper dir/non-dir */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user