Project

General

Profile

Actions

Bug #13897

open

loader: implement mount/unmount rootfs

Added by Toomas Soome over 2 years ago. Updated about 2 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Loader does allocate segment of block cache when disk device is opened (to read filesystem from it), and this segment is freed when we close this disk device.

Unfortunately, since current loader does not "mount" file system, the disk device is closed when we close the file; so the bcache lifetime is from file open() to close(). This is less than optimal for normal loader lifetime, where we identify the boot file system (where /boot tree is), reference it via currdev environment variable, and all file accesses are done using it till the operator will change currdev variable or we boot.

To work around this issue, we save the state of current file system referenced by currdev by mount(). This state is release by unmount() when we set new value for currdev variable. This state does keep disk device(s) open and therefore the bcache segment(s) are preserved.

This also does allow us to cache filesystem metadata (such as ufs superblock).

Note, this defect does not directly affect zfs, because zfs pools are currently kept "imported" after we probe for zfs pools.

Actions #1

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1564
Actions #2

Updated by Toomas Soome about 2 years ago

  • Subject changed from loader: avoid bcache flushes on currdev to loader: implement mount/unmount rootfs
  • Description updated (diff)
Actions

Also available in: Atom PDF