GNU bug report logs - #29038
df hangs on fifos/named pipes

Previous Next

Package: coreutils;

Reported by: Stephane Chazelas <stephane.chazelas <at> gmail.com>

Date: Sat, 28 Oct 2017 07:19:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 29038 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>,
 Stephane Chazelas <stephane.chazelas <at> gmail.com>, 29038 <at> debbugs.gnu.org
Cc: Martijn Dekker <martijn <at> inlv.org>
Subject: Re: bug#29038: df hangs on fifos/named pipes
Date: Sun, 29 Oct 2017 23:16:50 -0700
[Message part 1 (text/plain, inline)]
Pádraig Brady wrote:

> I suppose we could stat() and if that succeeds && !fifo, only then call open() ?
> Patch to do that is attached.

Better is to use open with O_NONBLOCK, as this avoids interpreting the file name 
twice in the usual case. Better yet is to use O_PATH if available, as this 
avoids interpreting the file name twice even when the file is unreadable or is a 
FIFO that would block. Also, the comment just before the code should be changed 
to match the altered code. Proposed followup patch attached.

It is puzzling that df calls fstat or stat, when it should just be calling 
fstatfs or statfs. But that is a different matter.
[0001-df-improve-fix-for-FIFOs.patch (text/x-patch, attachment)]

This bug report was last modified 7 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.