[PATCH] io: Return EBAFD for negative file descriptor on fstat (BZ #27559)

Stefan Liebler stli@linux.ibm.com
Fri Mar 12 13:44:24 GMT 2021


On 3/11/21 1:37 PM, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 11/03/2021 09:13, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> Now that fstat is implemented on top fstatat we need to handle negative
>>> inputs.
>>
>> Please mention AT_FDCWD in the commit message.  Or add a comment to the
>> code that the check rejects AT_FDCWD, which would otherwise be accepted
>> by the kernel.
>>
>> The patch looks okay otherwise.
> 
> Ack.  I will also add the missing tst-stat-lfs (which is just a wrapper
> to set __FILE_OFFSET_BITS=64).
> 

Hi Adhemerval,

I've just recognized that io/tst-stat is failing on my s390 (31bit) system:
tst-stat.c:94: numeric comparison failure

   left: 315117680 (0x12c85070); from: stx.stx_ctime.tv_nsec

  right: 0 (0x0); from: st.st_ctim.tv_nsec

tst-stat.c:96: numeric comparison failure

   left: 315117680 (0x12c85070); from: stx.stx_mtime.tv_nsec
  right: 0 (0x0); from: st.st_mtim.tv_nsec
tst-stat.c:94: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_ctime.tv_nsec
  right: 0 (0x0); from: st.st_ctim.tv_nsec
tst-stat.c:96: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_mtime.tv_nsec
  right: 0 (0x0); from: st.st_mtim.tv_nsec
tst-stat.c:94: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_ctime.tv_nsec
  right: 0 (0x0); from: st.st_ctim.tv_nsec
tst-stat.c:96: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_mtime.tv_nsec
  right: 0 (0x0); from: st.st_mtim.tv_nsec
tst-stat.c:94: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_ctime.tv_nsec
  right: 0 (0x0); from: st.st_ctim.tv_nsec
tst-stat.c:96: numeric comparison failure
   left: 315117680 (0x12c85070); from: stx.stx_mtime.tv_nsec
  right: 0 (0x0); from: st.st_mtim.tv_nsec
error: 8 test failures


But I have to admit, I haven't looked into the test yet and won't be
able before next week. But I wanted to report it now.

Bye,
Stefan


More information about the Libc-alpha mailing list