Re: [PATCH] Re: FAT bug in 2.2.10-ac8(was slocate never finishes in

Simon Kirby (sim@netnation.com)
Tue, 6 Jul 1999 11:05:04 -0400 (EDT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-21307229-931242446=:23200
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.LNX.4.10.9907061103562.494@oof.netnation.com>

On Tue, 6 Jul 1999, Alexander Viro wrote:
>
> Right. You do. It's a combination of my idiocy and idiocy of slocate
> authors. Sigh... In case of root directory the second entry (fake "..")
> got an d_off (offset of the next entry) equal to 0 *if* there were
> additional entries successfully filled by getdents(). My idiocy.
> Now, authors of slocate, in their infinite wisdom, decided to do
> seekdir after each readdir. Which means that they call getdents (on a
> decently-sized buffer) for each bloody offset. It is idiocy. Number of
> getdents() calls is 2 orders of magintude higher than it should be.
> Combination of those bogosities gave an infinite loop.
> Fix for FAT attached (it's against -ac8, with 2.2.9 it will get a
> line numbers offset but will apply fine).
>
> As for slocate... Look for seekdir(recdir, telldir()); and shoot
> it. Dunno if the author reads l-k (he didn't leave an address in the
> source), but just in case: seekdir() is *NOT* needed if you read
> sequentially. Just as fseek(); is not needed for files in the similar
> case.

The author works for NetNation (the same company I work for). I will
forward this to him.

Simon-

| Simon Kirby | Systems Administration |
| mailto:sim@netnation.com | NetNation Communications |
| http://www.netnation.com/ | Tech: (604) 684-6892 |

---559023410-21307229-931242446=:23200
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=foo
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.10.9907060227260.23200@weyl.math.psu.edu>
Content-Description:
Content-Disposition: ATTACHMENT; FILENAME=foo

LS0tIGZzL2ZhdC9kaXIuYwlUdWUgSnVsICA2IDAxOjQ0OjQ1IDE5OTkNCisr
KyBmcy9mYXQvZGlyLmMubmV3CVR1ZSBKdWwgIDYgMDE6NTA6MzAgMTk5OQ0K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KTsNCiAJCQlsb25nX2xlbiArPSBpOw0KIAkJ
fQ0KLQkJaWYgKGZpbGxkaXIoZGlyZW50LCBsb25nbmFtZSwgbG9uZ19sZW4s
IGxwb3MsIGludW0pIDwgMCkNCisJCWlmIChmaWxsZGlyKGRpcmVudCwgbG9u
Z25hbWUsIGxvbmdfbGVuLCAqZnVycmZ1LCBpbnVtKSA8IDApDQogCQkJZ290
byBGaWxsRmFpbGVkOw0KIAl9DQogDQogUmVjRW5kOg0KKwlmdXJyZnUgPSAm
bHBvczsNCiAJZmlscC0+Zl9wb3MgPSBjcG9zOw0KIAlnb3RvIEdldE5ldzsN
CiBFT0RpcjoNCg==
---559023410-21307229-931242446=:23200--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/