I found that this test succeeds on UBIFS:
stat_test /mnt/foo attr=+compressed attr=-compressed
Since stx_attributes can hold many flags, check the flags
correctly with the & operator.
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
attr = p->attr_flag;
if (set) {
- check(stx->stx_attributes && attr,
+ check((stx->stx_attributes & attr) == attr,
"Attribute %s should be set\n", arg);
} else {
- check(~stx->stx_attributes && attr,
+ check((stx->stx_attributes & attr) == 0,
"Attribute %s should be unset\n", arg);
}
}