Do not hold metadataMu on gofer O_DIRECT read path.

dentry.writeback() takes dataMu when it needs to. This lock seems to be
unnecessary.

PiperOrigin-RevId: 548763586
This commit is contained in:
Ayush Ranjan
2023-07-17 12:16:28 -07:00
committed by gVisor bot
parent c7a7e6b605
commit 05f62e5e66
-4
View File
@@ -141,10 +141,6 @@ func (fd *regularFileFD) PRead(ctx context.Context, dst usermem.IOSequence, offs
readErr error
)
if fd.vfsfd.StatusFlags()&linux.O_DIRECT != 0 {
// Lock d.metadataMu for the rest of the read to prevent d.size from
// changing.
d.metadataMu.Lock()
defer d.metadataMu.Unlock()
// Write dirty cached pages that will be touched by the read back to
// the remote file.
if err := d.writeback(ctx, offset, dst.NumBytes()); err != nil {