Skip to content

Commit c2e2f99

Browse files
committed
NTFS: NTFSLogClient: Skip reading restart record if volume mounted as readonly
1 parent cd3d236 commit c2e2f99

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

DiskAccessLibrary/FileSystems/NTFS/Log/NTFSLogClient.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2018 Tal Aloni <[email protected]>. All rights reserved.
1+
/* Copyright (C) 2018-2019 Tal Aloni <[email protected]>. All rights reserved.
22
*
33
* You can redistribute this program and/or modify it under the terms of
44
* the GNU Lesser Public License as published by the Free Software Foundation,
@@ -79,7 +79,15 @@ public NTFSLogClient(LogFile logFile)
7979
}
8080
else
8181
{
82-
m_currentRestartRecord = ReadRestartRecord(lastClientRestartLsn);
82+
if (!Volume.IsReadOnly)
83+
{
84+
m_currentRestartRecord = ReadRestartRecord(lastClientRestartLsn);
85+
}
86+
else
87+
{
88+
// If volume is mounted as readonly we can skip reading the actual restart record
89+
m_currentRestartRecord = new NTFSRestartRecord(1, 0);
90+
}
8391
}
8492
m_majorVersion = m_currentRestartRecord.MajorVersion;
8593
m_minorVersion = m_currentRestartRecord.MinorVersion;

0 commit comments

Comments
 (0)