• Home
  • Raw
  • Download

Lines Matching full:a

37 	* check that the source is not a directory
45 The source needs to be locked if it's a non-directory, target - if it's
46 a non-directory or about to be removed.
56 * if the parents don't have a common ancestor, fail the operation.
60 * verify that the source is not a descendent of the target and
61 target is not a descendent of source; fail the operation otherwise.
76 is a bunch of subtrees visible in dcache and locking happens on those.
78 that's not a problem, but there is a nasty twist - what should we do
82 the root of another"; there's also open-by-fhandle stuff, and there's a
84 to another and we run into it when we do a lookup.
86 For a lot of reasons we want to have the same directory present in dcache
88 a subdirectory that already has an alias, something needs to be done with
90 a root of separate tree, it gets attached to the directory we are doing a
92 a child of the directory we are looking in, it changes name to the one
94 However, if it's a child of some other directory, the things get trickier.
102 all we change is the view in dcache. Moreover, holding a directory locked
104 filesystem lock prevents any changes of tree topology, other than having a
105 root of one tree becoming a child of directory in another. In particular,
106 if two dentries have been found to have a common ancestor after taking
111 parents have a common ancestor.
117 For some filesystems a method can involve a directory operation on
120 using a local one as a cache, etc. In all such cases the operations
121 on other filesystems must follow the same locking rules. Moreover, "a
125 on a filesystem could trigger directory operations only on higher-ranked
137 There is a ranking on the locks, such that all primitives take
142 * put ->i_rwsem of all directories on a filesystem at the same rank,
149 For example, if we have NFS filesystem caching on a local one, we have
160 It's easy to verify that operations never take a lock with rank
164 set of threads. It is a cycle of several threads, each blocked on a lock
174 In other words, we have a cycle of threads, T1,..., Tn,
188 child), same-directory rename killing a subdirectory (ditto) and
191 There must be a cross-directory rename in the set; indeed,
193 we would have Dn a parent of D1, which is a parent of D2, which is
194 a parent of D3, ..., which is a parent of Dn. Relationships couldn't
197 we would have a loop.
201 generality we can assume that T1 is the one doing a cross-directory
204 In other words, we have a cross-directory rename that locked
205 Dn and blocked on attempt to lock D1, which is a parent of D2, which is
206 a parent of D3, ..., which is a parent of Dn. Relationships between
210 a common ancestor, which guarantees that ancestry relationships between
220 children must be involved and thus neither of them could be a descendent
224 It can't be a parent and its child; otherwise we would've had
225 a loop, since the parents are locked before the children, so the parent
226 would have to be a descendent of its child.
228 It can't be a parent and a child of another parent either.
229 Otherwise the child of the parent in question would've been a descendent
234 neither of the children is a descendent of another.
237 properties required for a minimal deadlock can not exist.
239 Note that the check for having a common ancestor in cross-directory
240 rename is crucial - without it a deadlock would be possible. Indeed,
243 an unrelated lookup splice a distant ancestor of source to some distant
246 distant ancestor. Add a bunch of rmdir() attempts on all directories
248 the locks) and voila - we have a deadlock.
255 Suppose after the operation there is a loop; since there hadn't been such
264 not have passed through the node itself, or we would've had a loop before
268 those chains must end after a finite number of steps.
274 end after a finite number of steps, which means that it can't be a part
278 ability to check that directory is a descendent of another object. Current
279 implementation assumes that directory graph is a tree. This assumption is
280 also preserved by all operations (cross-directory rename on a tree that would
281 not introduce a cycle will leave it a tree and link() fails for directories).