From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Willing to debug bug #3542 (23.0.94; File access via UNC path slow again under Windows) Date: Thu, 09 Jul 2009 21:47:31 +0300 Message-ID: <8363e1zoak.fsf@gnu.org> References: <7dbe73ed0907051401o26903ca3t9a67060f3a3417ad@mail.gmail.com> <83fxda1pef.fsf@gnu.org> <7dbe73ed0907060038w53699f77ie742996955ae8118@mail.gmail.com> <838wj11sz4.fsf@gnu.org> <83my7fz09s.fsf@gnu.org> <7dbe73ed0907081347q12dfd1a2lbbff915c49362f75@mail.gmail.com> <4A55D68D.8050407@gnu.org> <7dbe73ed0907090453s3e125b4ar142b90a268b105e2@mail.gmail.com> <7DAFC004A33C486A9E29A59689E7F02E@us.oracle.com> <4A5619F5.8010008@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1247167564 4918 80.91.229.12 (9 Jul 2009 19:26:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2009 19:26:04 +0000 (UTC) Cc: emacs-devel@gnu.org, drew.adams@oracle.com, mathias.dahl@gmail.com To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 09 21:25:57 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MOzFk-0004wX-HV for ged-emacs-devel@m.gmane.org; Thu, 09 Jul 2009 21:25:56 +0200 Original-Received: from localhost ([127.0.0.1]:35449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOzFi-0008EQ-LP for ged-emacs-devel@m.gmane.org; Thu, 09 Jul 2009 15:25:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOzBp-0005Pk-69 for emacs-devel@gnu.org; Thu, 09 Jul 2009 15:21:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOzBn-0005Ob-Lm for emacs-devel@gnu.org; Thu, 09 Jul 2009 15:21:52 -0400 Original-Received: from [199.232.76.173] (port=47468 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOzBn-0005OR-AF for emacs-devel@gnu.org; Thu, 09 Jul 2009 15:21:51 -0400 Original-Received: from mtaout1.012.net.il ([84.95.2.1]:29875) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOzBk-0007ji-Rk; Thu, 09 Jul 2009 15:21:49 -0400 Original-Received: from conversion-daemon.i-mtaout1.012.net.il by i-mtaout1.012.net.il (HyperSendmail v2007.08) id <0KMJ00E002QTDV00@i-mtaout1.012.net.il>; Thu, 09 Jul 2009 21:47:30 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.126.249.41]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KMJ001NL2V5RWA0@i-mtaout1.012.net.il>; Thu, 09 Jul 2009 21:47:30 +0300 (IDT) In-reply-to: <4A5619F5.8010008@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:112255 Archived-At: > Date: Fri, 10 Jul 2009 00:25:25 +0800 > From: Jason Rumney > CC: 'Mathias Dahl' , > 'Eli Zaretskii' , > emacs-devel@gnu.org > > Drew Adams wrote: > >> Hmm... There is a suggestion to use it only on fast machines at the > >> same time it is turned on by default. Shouldn't it be the other way > >> around? Btw, I consider my machine to be quite fast even though it is > >> a couple of years old. > >> > >> I suggest we change the default value of this variable to nil (or make > >> the code faster). > >> > > > > Dumb question: Is there a way for Emacs to know whether the format is NTFS or > > FAT(32)? If so, then Emacs could use nil for FAT volumes. > > > That suggestion dates back to the days when "fast machines" were running > at 200MHz or so. The problem here is not the speed of the machine, but > the network. The default value of w32-get-true-file-attributes is > 'local, which means nil when going across the network, but apparently > that is not being recognized in all places - which I think is what Eli > is investigating. Right. We didn't treat UNC file names as remote, it's as simple as that. I installed the patch below on the trunk. Stefan and Yidong, is it okay to install on the release branch as well? 2009-07-09 Eli Zaretskii * w32.c (stat): Treat UNC file names as residing on remote drives. (Bug#3542) --- src/w32.c.orig 2009-06-21 10:38:18.000000000 +0300 +++ src/w32.c 2009-07-09 16:31:51.250000000 +0300 @@ -3154,11 +3154,13 @@ } } - /* GetDriveType needs the root directory of NAME's drive. */ - if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) - devtype = GetDriveType (NULL); /* use root of current diectory */ + if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1])) + devtype = DRIVE_REMOTE; /* assume UNC name is remote */ + else if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) + devtype = GetDriveType (NULL); /* use root of current drive */ else { + /* GetDriveType needs the root directory of NAME's drive. */ strncpy (drive_root, name, 3); drive_root[3] = '\0'; devtype = GetDriveType (drive_root);