Skip to content

Commit 3945f90

Browse files
committed
fix: resolve RwLock across await bug
1 parent 47da7e1 commit 3945f90

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/mount.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,18 +355,20 @@ impl MountTable {
355355
hmac_level: MountEntryHMACLevel,
356356
) -> Result<(), RvError> {
357357
let mut need_persist = false;
358-
let mounts = self.entries.read()?;
358+
{
359+
let mounts = self.entries.read()?;
359360

360-
for mount_entry in mounts.values() {
361-
let mut entry = mount_entry.write()?;
362-
if entry.table.is_empty() {
363-
entry.table = MOUNT_TABLE_TYPE.to_string();
364-
need_persist = true;
365-
}
361+
for mount_entry in mounts.values() {
362+
let mut entry = mount_entry.write()?;
363+
if entry.table.is_empty() {
364+
entry.table = MOUNT_TABLE_TYPE.to_string();
365+
need_persist = true;
366+
}
366367

367-
if entry.hmac.is_empty() && hmac_key.is_some() && hmac_level == MountEntryHMACLevel::Compat {
368-
entry.calc_hmac(hmac_key.unwrap())?;
369-
need_persist = true;
368+
if entry.hmac.is_empty() && hmac_key.is_some() && hmac_level == MountEntryHMACLevel::Compat {
369+
entry.calc_hmac(hmac_key.unwrap())?;
370+
need_persist = true;
371+
}
370372
}
371373
}
372374

0 commit comments

Comments
 (0)