On Tue, Aug 12, 2008 at 05:28:28PM -0700, Linus Torvalds wrote:*cringe* I agree, but... there's another shitpile in the same area and there we are _really_ buggered - take a look at what ncpfs/smbfs/cifs/<parts of> procfs are pulling off with very odd attempts to dump stuff into dcache. That means manual equivalent of lookup and you _do_ want some exclusion for that. If nothing else, you want to prevent multiple dentries for the same subdirectory... And rwsem for reading wouldn't help at all - readdir/readdir contention might be annoying, but it's readdir/lookup that really hurts. I know. And things like exportfs use of vfs_readdir() are also rather painful. I remember ;-) However, f_version/i_version mess at that place simply an ancient crap - we *are* holding i_mutex and we are using generic_file_lseek(). IOW, it simply hadn't been reviewed since then - or reviewers had been stunned into glazed-eyes mode by the entire thing. Don't. Get. Me. Started. Hell, at least by now somebody had cleaned htree code into nearly readable form; maybe it might be doable... What _can_ a common helper do, anyway, when we are busy parsing an arseload of possibly corrupt data in whatever weird format fs insists upon? As for the locking... I toyed with one idea for a while: instead of passing a callback and one of many completely different structs, how about a common *beginning* of a struct, with callback stored in it along with several common fields? Namely, * count of filldir calls already made * pointer to file in question * "are we done" flag And instead of calling filldir(buf, ...) ->readdir() would call one of several helpers: * readdir_emit(buf, ...) - obvious * readdir_relax(buf) - called in a spot convenient for dropping and retaking lock; returns whether we need to do revalidation. * readdir_eof(buf) - end of directory * maybe readdir_dot() and readdir_dotdot() - those are certainly common enough That's the obvious flagday stuff, but since we need to give serious beating to most of the instances anyway... Might as well consider something in that direction. --
| Jeremy Fitzhardinge | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Michael Grollman | Re: 8169 Intermittent ifup Failure Issue With RTL8102E Chipset in Intel's New D945... |
