Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 523923

Summary: removing many files takes a long time
Product: Red Hat Enterprise Linux 5 Reporter: Adrien Kunysz <akunysz>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: asersen, azelinka, iannis, kdudka, mluscon
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: coreutils-5.97-28.el5 Doc Type: Bug Fix
Doc Text:
Previously, deletion of a large number of files via the rm utility was taking too much time. With this update, the code has been optimized and the deletion is now faster.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 10:36:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
backport of the upstream patch
none
df: do not fail if open(2) on the device fails in df
none
Resource leak fix for fts.c none

Description Adrien Kunysz 2009-09-17 08:24:30 UTC
Created attachment 361452 [details]
backport of the upstream patch

This is a request to backport upstream commit 24412edeaf556a in RHEL to make rm much faster on directories containing a large number of files: http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=24412edeaf556a

From diff NEWS:
+ chgrp, chmod, chown, chcon, du, rm: now all display linear performance,
+ even when operating on million-entry directories on ext3 and ext4 file
+ systems. Before, they would exhibit O(N^2) performance, due to linear
+ per-entry seek time cost when operating on entries in readdir order.
+ Rm was improved directly, while the others inherit the improvement
+ from the newer version of fts in gnulib.

Comment 1 Adrien Kunysz 2009-09-17 08:28:34 UTC
Created attachment 361454 [details]
df: do not fail if open(2) on the device fails in df

This also requires some change to df as per attached patch. Both patches have been backported by Olivier Fourdan, thanks to him.

Comment 3 Ondrej Vasik 2009-09-17 08:46:29 UTC
Thanks for backport Olivier. Just want to mention that upstream recently did another improvement for rm - rewrite to fts - but this is probably too complex for RHEL-5. 
df patch is already in another bugzilla (#520630)...

Comment 4 RHEL Program Management 2009-11-06 18:43:59 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 7 RHEL Program Management 2010-08-09 18:18:33 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2011-01-11 20:15:26 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 10 RHEL Program Management 2011-01-11 22:21:53 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 20 Tomas Capek 2011-07-13 12:16:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, deletion of a large number of files via the rm utility was taking too much time. With this update, the code has been optimized and the deletion is now faster.

Comment 21 errata-xmlrpc 2011-07-21 10:36:28 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1074.html

Comment 22 errata-xmlrpc 2011-07-21 12:11:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1074.html