PSA: Exclusive lock on removeEntry() in File System Access API

42 views
Skip to first unread message

Daseul Lee

unread,
Nov 21, 2022, 2:39:12 PM11/21/22
to blink-dev, Austin Sullivan

Hello blink-dev,



Contact emails

asu...@chromium.org, ds...@chromium.org



Specification

https://github.com/whatwg/fs/issues/39

https://github.com/whatwg/fs/pull/73



Summary

FileSystemAccessDirectoryHandle.removeEntry() currently takes a shared lock, and we plan on changing it to take an exclusive lock.


With a shared lock, a file entry can be removed from a directory while there is an open FileSystemWritableFileStream. This is the result of underspecification of removeEntry(), which was added before the concept of locking was introduced to File System Access API. By changing to the exclusive lock, removeEntry() will not be allowed when there is an open writable; similarly, any operation that requires an exclusive lock to the handle will not be allowed until removeEntry() is completed. This is consistent with other file-modifying operations like move() and remove(), which already take an exclusive lock.



Tracking Bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1254078




Reply all
Reply to author
Forward
0 new messages