Bug 1509243

Summary: fuser can hang on nonexistent file
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: psmiscAssignee: Jaromír Cápík <jaromir.capik>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: fedora, hhorak, jaromir.capik, jrybar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: psmisc-23.1-4.1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1509245 (view as bug list) Environment:
Last Closed: 2019-04-30 13:28:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1509245, 1693785    

Description Karel Volný 2017-11-03 12:06:28 UTC
Description of problem:
I have found a problem during mariadb startup, which turned out to be caused by a `fuser` call that timed out due to broken NFS.

While that's a string of unfortunate conditions, making `fuser` behave differently would be IMHO a good thing.

The problem is when a file doesn't exist, instead of bailing out immediately, fuser tries to stat tons of other things, and stating a stale NFS mount leads to hanging on it.

fuser shouldn't do this - I don't know what sense does it make during normal operation (if the file exists), it still would be nice if it could be skipped and so fuser doesn't get blocked by NFS.

But I'm pretty sure it doesn't make any sense when the file doesn't exist ... why to wait for "Specified filename ... does not exist." message until the system is scanned while it can be spit out immediately?

Version-Release number of selected component (if applicable):
psmisc-23.1-2.fc27.x86_64

How reproducible:
always

Steps to Reproduce:
0. have some nfs mounts
[supposing 'kravina' doesn't exist]
1. strace fuser kravina 2>&1 | grep your/mount

Actual results:
stat("your/mount", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

Expected results:
empty output, grep doesn't match your/mount


Additional info:

Comment 1 Ben Cotton 2018-11-27 18:19:00 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Jan Rybar 2019-04-30 13:28:59 UTC
Fixed also in F28 and F30.

With latest update, fuser now does not do redundant /proc walkthrough if invalid filename given.
https://bodhi.fedoraproject.org/updates/FEDORA-2019-65327463be