tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: locking patches for ufs_rename



David Holland <dholland-tech%netbsd.org@localhost> wrote:
> I don't see how. More detail?
> 
> If someone does rename("/x", "/a/b/c/d/e/f/g/h/i/j/k/x"), the parent
> check has to inspect each one of those intermediate directories. Then,
> once it's done so, something has to make sure none of those
> directories get modified until the rename is complete.

You are right, sorry.  It wont work without some check/restart sequence,
e.g. global generation number, or as you call timestamping.  But keeping
that atomic would probably be also ugly.

Can you elaborate on your timestamping idea?

> Well, they think it does. Unfortunately, the code in our zfs import
> that I looked at the other day is wrong and has a bunch of deadlock
> cases. (I dunno how closely it reflects what's in Solaris, but I
> suspect it hasn't been changed around that drastically.)

I meant their UFS rename, did not look at ZFS rename.

> Such complicated schemes are never a good idea anyway.
> 

Fully agree, but global rename lock hit to concurrency is not nice, so
effort to find some solution would be good.  On the other hand, if we
push it to be used only on cross-directory renames, then lockstat might
show that it's good enough!

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index