Arghh. Found a lack of forethought in the upspin client library.

50 views
Skip to first unread message

David Presotto

unread,
Jul 25, 2024, 3:33:01 PM7/25/24
to Upspin, Andrew Gerrand, Rob Pike, Eric Grosse, Rodrigo Schio
Rodrigo was having problems with upspinfs.  I couldn't duplicate but got logs from him.  I tracked it down to upspinfs getting out of sync with the sequence number of a directory entry.

After drilling down, I found that  it was the cause of a Setattr request to change the mtime.  I use the upspin/client library because it's too hard to not.  However one function, SetTime, doesn't return the updated DirEntry after it does a Dir.Put.  Upspinfs needs that DIrEntry to update its knowledge of the sequence number for subsequent Puts.

I believe my only solution is to add a SetTimeSequenced that takes a sequence numner and returns a DirEntry just as I added a PutSequenced for the same problem with Put.

Anyone care to convince me otherwise?

Eric Grosse

unread,
Jul 25, 2024, 3:59:01 PM7/25/24
to David Presotto, Upspin, Andrew Gerrand, Rob Pike, Rodrigo Schio
Agreed, that's the right fix if you're worried about TOCTOU race for doing Lookup after SetTime. I'm around and will respond promptly to the CL.

Özgür Kesim

unread,
Jul 26, 2024, 6:34:30 AM7/26/24
to David Presotto, Upspin, Andrew Gerrand, Rob Pike, Eric Grosse, Rodrigo Schio
Hi David,

SetTimeSequenced sounds like the right way to enforce idempotency.

-oec

Thus spake David Presotto (pres...@gmail.com):
> --
> You received this message because you are subscribed to the Google Groups "Upspin" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to upspin+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/upspin/CAC_Z_pTMaYu7Y%2Bv-32ZJPM-eGWDVet%3Dqrt3GuVb_57JMd6OO6A%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages