We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb95603 commit d186f13Copy full SHA for d186f13
pkg/sentry/fs/dirent.go
@@ -1342,7 +1342,15 @@ func (d *Dirent) InotifyEvent(events, cookie uint32) {
1342
1343
// The ordering below is important, Linux always notifies the parent first.
1344
if d.parent != nil {
1345
- d.parent.Inode.Watches.Notify(d.name, events, cookie)
+ // name is immediately stale w.r.t. renames (renameMu doesn't
1346
+ // protect against renames in the same directory). Holding
1347
+ // d.parent.mu around Notify() wouldn't matter since Notify
1348
+ // doesn't provide a synchronous mechanism for reading the name
1349
+ // anyway.
1350
+ d.parent.mu.Lock()
1351
+ name := d.name
1352
+ d.parent.mu.Unlock()
1353
+ d.parent.Inode.Watches.Notify(name, events, cookie)
1354
}
1355
d.Inode.Watches.Notify("", events, cookie)
1356
0 commit comments