t_stripealign: Fix fibmap error handling
authorCarlos Maiolino <cmaiolino@redhat.com>
Fri, 23 Aug 2019 09:25:30 +0000 (11:25 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sat, 24 Aug 2019 15:24:21 +0000 (23:24 +0800)
commitc9adaa192f17a779c88f73477b6d2fee2595fc7a
treecccba333ad09fe1128dc32f4aafc300a253d667e
parent9cd2fe8a935797a9b5ee8771521b7923ac3ac919
t_stripealign: Fix fibmap error handling

FIBMAP only returns a negative value when the underlying filesystem
does not support FIBMAP or on permission error. For the remaining
errors, i.e. those usually returned from the filesystem itself, zero
will be returned.

We can not trust a zero return from the FIBMAP, and such behavior
made generic/223 succeed when it should not.

Also, we can't use perror() only to print errors when FIBMAP failed,
or it will simply print 'success' when a zero is returned.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/t_stripealign.c