overlay: File capabilities should not be lost over copy-up
Make sure file capabilities are not lost over copy-up when file is
opened for WRITE but nothing is actually written to it.
Following commit introduced regression where if a lower file with
CAP_SETUID is opened for writing, and capability is cleared over copy up.
bd64e57586d3 ("ovl: During copy up, first copy up metadata and then data")
A later kernel patch will fix it. This test will help avoid introducing
such regressions again.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>