[haiku-bugs] Re: [Haiku] #18137: VirtualMemory preflet: lists RAM FS Volume as valid swap file storage option

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Wed, 14 Dec 2022 17:46:37 -0000

#18137: VirtualMemory preflet: lists RAM FS Volume as valid swap file storage
option
------------------------+-------------------------
  Reporter:  bipolar    |      Owner:  nobody
      Type:  bug        |     Status:  new
  Priority:  normal     |  Milestone:  Unscheduled
 Component:  - General  |    Version:  R1/beta4
Resolution:             |   Keywords:
Blocked By:             |   Blocking:
  Platform:  All        |
------------------------+-------------------------
Description changed by bipolar:

Old description:

As per the title:

The VirtualMemory preflet shows the RAM FS volume (from
/system/var/shared_memory) as an option of where to place the swap file
(when auto-swap management option is off).

That seems like a recipe for problems, right?  (I didn't dared to
actually try it out).

Anyway.... Any suggestions on how to better filter FSes like that so they
don't pop up in VirtualMemory?

---

A bit of a tangent:

Seeing that VirtualMemory checks each `BVolume`'s `IsPersistent()` (among
other fs_info flag related methods)... and reading the Be Book, that
says: "IsPersistent() - Is the storage persistent (such as on a floppy or
hard disk)?"

I thought... why ramfs is setting B_FS_IS_PERSISTENT?

(In an attempt to fix the issue with the VM preflet, I've tried removing
B_FS_IS_PERSISTENT from ramfs, but that cause KDLs when you attempt to
write to a RAMFS you just mounted).


I guess "B_FS_IS_PERSISTENT/IsPersistent()" only means that an FS can
store data, even if it is just temporarily?


In that case... Is there a way to check for "the other meaning" of
persistent (as in... "you can reasonably expect data to survives
reboots"? (seems something backup software, for example, might care
about).

New description:

 As per the title:

 The VirtualMemory preflet shows the RAM FS volume (from
 /system/var/shared_memory) as an option of where to place the swap file
 (when auto-swap management option is off).

 That seems like a recipe for problems, right?  (I didn't dared to actually
 try it out).

 Anyway.... Any suggestions on how to better filter FSes like that so they
 don't pop up in VirtualMemory?

 ---

 A bit of a tangent:

 Seeing that VirtualMemory checks each `BVolume`'s `IsPersistent()` (among
 other fs_info flag related methods)... and reading the Be Book, that says:
 "IsPersistent() - Is the storage persistent (such as on a floppy or hard
 disk)?"

 I thought... why ramfs is setting B_FS_IS_PERSISTENT?

 (In an attempt to fix the issue with the VM preflet, I've tried removing
 B_FS_IS_PERSISTENT from ramfs, but that cause KDLs when you attempt to
 write to a RAMFS you just mounted). [Note 1]


 I guess "B_FS_IS_PERSISTENT/IsPersistent()" only means that an FS can
 store data, even if it is just temporarily?


 In that case... Is there a way to check for "the other meaning" of
 persistent (as in... "you can reasonably expect data to survives reboots"?
 (seems something backup software, for example, might care about).

 ---

 Edit: [Note 1]

 After a second attempt, I couldn't reproduce the KDLs after removing
 B_FS_IS_PERSISTENT, but doing:

 {{{
 mkdir ~/test_ramfs
 mount -t ramsfs ~/test_ramfs
 touch ~/test_ramfs/test.txt
 }}}

 Also creating a "New Folder" there from Tracker... Then, when attempting
 to remove that "test.txt" file and "New Folder" from Tracker... caused
 both Terminal and Tracker to hand and become unkillable.

 (system wide ramfs was disabled from the boot menu when testing the
 modified one, of course).

--
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/18137#comment:2>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: