[tahoe-dev] [tahoe-lafs] #943: "tahoe mv" deleted my files?

tahoe-lafs trac at allmydata.org
Mon Feb 8 18:36:23 PST 2010


#943: "tahoe mv" deleted my files?
---------------------------------------------+------------------------------
 Reporter:  zooko                            |           Owner:           
     Type:  defect                           |          Status:  new      
 Priority:  major                            |       Milestone:  undecided
Component:  code-frontend-cli                |         Version:  1.6.0    
 Keywords:  tahoe-mv usability preservation  |   Launchpad_bug:           
---------------------------------------------+------------------------------

Comment(by davidsarah):

 I suspect that you moved the directory {{{Diablo_Swing_Orchestra-
 The_Butcher's_Ballroom}}} into itself. That is what the bash script
 literally says to do -- the script would have first moved all of the .mp3
 files (which happen to be listed before {{{Diablo_Swing_Orchestra-
 The_Butcher's_Ballroom}}}) into that directory, and then do:
 {{{
 time ~/playground/tahoe-lafs/bin/tahoe mv --dir-
 cap=URI:DIR2:zssplcanct54waahwjjngjyhke:vvdpvxybwc6x7az5i64heqdnql2mdi6fspvxtje4iwzkcvvwukpq
 "tahoe:Diablo_Swing_Orchestra-The_Butcher's_Ballroom" tahoe
 :Diablo_Swing_Orchestra-The_Butcher\'s_Ballroom/
 }}}
 which causes said directory to disappear up its own... erm, I mean, become
 a child of itself.

 I don't understand why the subsequent {{{mv}}}s printed {{{OK}}}. They
 didn't work, as I wouldn't expect since {{{Diablo_Swing_Orchestra-
 The_Butcher's_Ballroom}}} wouldn't be a child of
 {{{URI:DIR2:zssplcanct54waahwjjngjyhke:vvdpvxybwc6x7az5i64heqdnql2mdi6fspvxtje4iwzkcvvwukpq}}}
 at that point. It seems like a bug that they printed {{{OK}}}, independent
 of whether the preceding "move a directory into itself" command should
 have been allowed.

 If you still have a direct cap to the {{{Diablo_Swing_Orchestra-
 The_Butcher's_Ballroom}}} directory, then it should still exist, with the
 .mp3 files in it.

 A directory being a child of itself isn't a problem per se, in a Tahoe
 filesystem. OTOH, Unix {{{mv}}} will not allow moving a directory into
 itself. On cygwin:
 {{{
 $ mv foo foo/
 mv: cannot move `foo' to a subdirectory of itself, `foo/foo'
 }}}

 However [source:src/allmydata/scripts/tahoe_mv.py tahoe mv] works by doing
 a PUT operation to create the destination link, and then if that
 succeeded, doing a DELETE on the source link. It would be possible to
 check that the source object is not the same as the parent of the
 destination link, but that only catches some cases that are prevented by
 Univ {{{mv}}}: you would still be able to move a directory into an
 indirect descendant, and it isn't clear how to prevent that.

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/943#comment:1>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list