[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bugs and problems while implementing mount(2)

From: Ryan Jeffrey
Subject: Bugs and problems while implementing mount(2)
Date: Sat, 03 Oct 2020 17:36:34 -0700
User-agent: mu4e 1.4.13; emacs 27.1

Hello friends,

I recently completed a first draft of an implementation of mount(2), umount(2), 
and umount2(2) as described in:


Here is a list of problems I encountered while making this patch:

- I was not able to place the system calls into libc as the instructions on the 
contributing page described. Perhaps it is because of my ignorance of libc and 
how it works and builds, but I kept running into issues because the mount logic 
depends on libraries in the HURD like libfshelp, and I don't know how to 
resolve those issues without moving the dependencies with the mount logic. My 
current solution is to just place the new system calls into libfshelp.

- I ran into a bug during testing that makes it impossible to remount file 
systems. I did some printf debugging, and I found that on line 234 of the 
HURD's utils/mount.c, which is the mount(8) implementation, the function fs_sys 
always sets `fsys_t mounted', which I believe is a mach port to `fs''s 
translator, to MACH_PORT_NULL. This means that any remount will fail. mount(2) 
also has this problem due to its code just being mount(8)'s code but slightly 
reorganized and with some additions from Linux.

Here is a test I performed for remounting where myextfile is a file formatted 
to ext2:
$ mount myextfile mnt
$ mount mnt -o remount,noatime
mount: /home/ryan/src/mount-hurd/test/mnt not already mounted

Of course, mnt is mounted, it shows up in /etc/mtab, it's not empty, I can 
modify it, and treat it as any other file system.

The system call implementations can be found here:


Thanks for your time,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]