Re: [PATCH v2] holetest: Use pid_t type for fork(2) return value

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Fri, Oct 06, 2017 at 08:19:46AM +0000, Rostislav Skudnov wrote:
> ---
> Hello Christoph,
> 
> I think using uint64_t is fine since pthread_t is either a pointer or a ulong,
> and pid_t is an int, so uint64_t acts as a "superset" of those types. Valid
> PIDs are positive, so the difference in signedness should not be a problem.

Well.  For one it loses any typeѕafety, second uint64_t is not
guaranteed to store a pointer (although in practice for the platforms
xfstests runs on it does), for that you'd need a uintptr_t.

Anyway, as a quick fix your patch below looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Although I still thing that code is extremtly badly written and using
proper types to store a pthread_t * vs pid would be a good idea.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux