ovl: make redirect/metacopy rejection consistent
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 7 Feb 2025 15:39:55 +0000 (16:39 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 30 Apr 2025 08:55:27 +0000 (10:55 +0200)
commita6fcfe9bb26df18ba7b5c4d064edd13c80ea2466
tree729fd37f60154d1fa4d001f928b278521a1022ac
parent924577e4f6ca473de1528953a0e13505fae61d7b
ovl: make redirect/metacopy rejection consistent

When overlayfs finds a file with metacopy and/or redirect attributes and
the metacopy and/or redirect features are not enabled, then it refuses to
act on those attributes while also issuing a warning.

There was an inconsistency in not checking metacopy found from the index.

And also only warning on an upper metacopy if it found the next file on the
lower layer, while always warning for metacopy found on a lower layer.

Fix these inconsistencies and make the logic more straightforward, paving
the way for following patches to change when data redirects are allowed.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/namei.c