[PATCH] fix rescan_partitions to return errors properly