httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@hyperreal.org>
Subject Re: cvs commit: apache-1.3 STATUS
Date Tue, 05 May 1998 02:12:30 GMT
At 07:11 PM 5/4/98 -0400, you wrote:
>Martin Kraemer wrote:
>> 
>> On Mon, May 04, 1998 at 08:02:35PM +0400, Dmitry Khrustalev wrote:
>> > stat is expensive because it has to run namei, fstat is not so expensive.
>> > opening file in get_path_info, and saving fd in request_rec and using
this
>> > saved fd later saves ~1/6 of system time here.
>> 
>> I just re-checked my old archives and found out that the solution has
>> been there all the time -- I added it last fall. Look into the source
>> main/util.c, search for the define unvoted_DISALLOW_DEVICE_ACCESS!
>> It uses fstat to control device access for configuration files (i.e.,
>> everything which uses ap_pcfg_openfile()).
>> 
>> If an attempt is made to open a (non-/dev/null) special file, then
>> an error is logged and the open attempt aborted.
>> 
>> Does that help? Should we vote on it?
>> 
>
>Yeah, I saw that and mentioned it in one of the follow-ups. My suggestion
>was that ap_pcfg_openfile have another parameter that determines if
>the fstat actually be done, that way we can use it as needed but
>we don't get the performance hit when we don't... Course, if it's
>used only for config-file opens then it's not that big a deal. :)

When would you not want to check to see if a file you're opening is a
device?  Maybe when we have a metadata cache, perhaps.... but for now we
should just put in a check like what was in Martin's patch.  Since opening
the config file happens only rarely, I'm +1 for taking Martin's
"unvoted_DISALLOW_DEVICE_ACCESS" out of IFDEF's.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Mime
View raw message