Project

General

Profile

Actions

Bug #13897

open

loader: implement mount/unmount rootfs

Added by Toomas Soome about 1 year ago. Updated 10 months ago.

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

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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 about 1 year ago

  • Gerrit CR set to 1564
Actions #2

Updated by Toomas Soome 10 months 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