sapling/eden/fs/inodes
Adam Simpkins 8b4c984b28 always load affected inodes in rename(), and update lock ordering
Summary:
This updates the TreeInode::rename() code to handle concurrency better.
In particular:

- The code now ensures that both the source inode being renamed and destination
  inode (if it exists) are loaded.  This simplifies issues when an inode is
  being loaded at the same time a rename is in progress.  This ensures that any
  pending load is processed before the rename takes place.  (All promises for
  the load might not be fulfilled before the rename completes, but the relevant
  TreeInode and InodeMap data structures are updated before the rename occurs.)

  This does mean that the rename code potentially might have to retry several
  times if the inode it began loading is no longer the affected source or
  destination or child once the load completes.  However, this seems like a
  reasonable trade-off, compared to dealing with the complications that would
  arise with the load code having to handle renames occuring before load
  completion.

- The code now implements proper lock ordering, to avoid acquiring locks in
  conflicting orders that might cause deadlock with other threads also trying
  to acquire the same locks.  The InodeLocks.md document has been updated to
  clarify the TreeInode lock ordering requirements.

Reviewed By: wez

Differential Revision: D4493526

fbshipit-source-id: 627393fafad90eb551aea62be7762d59ed043abe
2017-02-03 18:35:03 -08:00
..
test always load affected inodes in rename(), and update lock ordering 2017-02-03 18:35:03 -08:00
Dirstate.cpp implement Future-based recursive Inode lookup 2017-01-25 16:56:12 -08:00
Dirstate.h implement Future-based recursive Inode lookup 2017-01-25 16:56:12 -08:00
DirstatePersistence.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
DirstatePersistence.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
EdenDispatcher.cpp raise the attribute TTL to maximum possible, add basic invalidation 2017-01-24 09:39:06 -08:00
EdenDispatcher.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
EdenMount.cpp implement Future-based recursive Inode lookup 2017-01-25 16:56:12 -08:00
EdenMount.h always load affected inodes in rename(), and update lock ordering 2017-02-03 18:35:03 -08:00
EdenMounts.cpp implement Future-based recursive Inode lookup 2017-01-25 16:56:12 -08:00
EdenMounts.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
FileData.cpp make sure FileData always open the overlay file for materialized files 2017-01-31 13:33:57 -08:00
FileData.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
FileHandle.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
FileHandle.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
FileInode.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
FileInode.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodeBase.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodeBase.h Add InodeBase::getParent() 2017-01-25 15:06:05 -08:00
InodeError.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodeError.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodeMap.cpp clean up some subtle issues with inode loading completion 2017-01-25 16:56:12 -08:00
InodeMap.h clean up some subtle issues with inode loading completion 2017-01-25 16:56:12 -08:00
InodePtr-defs.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodePtr.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodePtr.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
InodePtrFwd.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
Overlay.cpp update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
Overlay.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
overlay.thrift Flip Dirstate -> EdenMount dependency. 2016-11-26 12:01:41 -08:00
ParentInodeInfo.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00
TARGETS codemod: fixup more build targets in TARGETS 2017-01-14 01:44:01 -08:00
TreeInode.cpp always load affected inodes in rename(), and update lock ordering 2017-02-03 18:35:03 -08:00
TreeInode.h always load affected inodes in rename(), and update lock ordering 2017-02-03 18:35:03 -08:00
TreeInodeDirHandle.cpp Add InodeBase::getParent() 2017-01-25 15:06:05 -08:00
TreeInodeDirHandle.h update all copyright statements to "2016-present" 2017-01-20 22:03:02 -08:00