Skip to contentSkip to conversation

Hostfs and Humfs

uml-devel BlaisorBlade 3 participants 6 messages Apr 1, 2004 – May 26, 2004 3 messages not in the archive User-mode Linux (UML)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Alle 04:17, martedì 30 marzo 2004, Jeff Dike ha scritto:

Quoted 7 lines
Quoted 2 lines · [email protected] said:

Is there any clever way to reset the root password for users, aside from deleting the cow? "linux single" is fine, but aside from that?

I'm finishing up a new hostfs-like filesystem which I want to become the preferred mechanism to boot UMLs because of its ability to mmap data from the host, eliminating duplicate copies of file data in memory.

Al Viro said you that ubd=mmap won't work, right? Would you give me the magic words to search on the LKML or forward the messages to the -devel list?

Also, I've started writing a little patch for 2.6 to hostfs to generalize it like you said (which I attached). It is just 2-3 hours of work, since I had some doubt: do you like adding a hostfs_user_operations stored into super_block->s_fs_info and calling all the functions of hostfs_user.c indirectly (the trivial and long part I did not do yet)?

Would it be useful for your "humfs", as it seems to me?

Signature · 2 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
fs/hostfs/hostfs_kern.c renamed from fs/hostfs/hostfs_kern.c.fix +26 -0
@@ -33,6 +33,30 @@
 	struct inode vfs_inode;
 };
 
+struct hostfs_private_fs_info { /* To fill s_fs_info; it will need a list_head field.*/
+	struct hostfs_user_operations *ops;
+	struct list_head link;
+};
+
+/* For now no locking, it is called in initialization.*/
+static struct hostfs_private_fs_info hostfs_info;
+
+int register_hostfs_ops(struct hostfs_user_operations* ops)
+{
+	hostfs_info.ops = ops;
+	return 0;
+}
+
+static inline struct hostfs_user_operations* HOSTFS_OPS_INO(struct inode* ino)
+{
+	return ((struct hostfs_private_fs_info*) ino->i_sb->s_fs_info)->ops;
+}
+
+static inline struct hostfs_user_operations* HOSTFS_OPS_FILE(struct file* file)
+{
+	return ((struct hostfs_private_fs_info*) file->f_dentry->d_sb->s_fs_info)->ops;
+}
+
 static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode)
 {
 	return(list_entry(inode, struct hostfs_inode_info, vfs_inode));
@@ -927,6 +951,8 @@
 	sb->s_blocksize_bits = 10;
 	sb->s_magic = HOSTFS_SUPER_MAGIC;
 	sb->s_op = &hostfs_sbops;
+	/* Just temporary;*/
+	sb->s_fs_info = &hostfs_info;
 
 	if((data == NULL) || (*data == '\0')) 
 		data = root_ino;
fs/hostfs/hostfs.h renamed from fs/hostfs/hostfs.h.fix +41 -0

53 lines not on this page · raw message

fs/hostfs/hostfs_user.c renamed from fs/hostfs/hostfs_user.c.fix +25 -0
@@ -341,6 +341,31 @@
 	return(0);
 }
 
+static struct hostfs_user_operations host_ops = {
+	.stat_file      = stat_file,
+	.file_type      = file_type,
+	.access_file    = access_file,
+	.open_file      = open_file,
+	.open_dir       = open_dir,
+	.read_dir       = read_dir,
+	.read_file      = read_file,
+	.write_file     = write_file,
+	.lseek_file     = lseek_file,
+	.close_file     = close_file,
+	.close_dir      = close_dir,
+	.file_create    = file_create,
+	.set_attr       = set_attr,
+	.make_symlink   = make_symlink,
+	.unlink_file    = unlink_file,
+	.do_mkdir       = do_mkdir,
+	.do_rmdir       = do_rmdir,
+	.do_mknod       = do_mknod,
+	.link_file      = link_file,
+	.do_readlink    = do_readlink,
+	.rename_file    = rename_file,
+	.do_statfs      = do_statfs,
+};
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
#3 lore raw
Quoted 2 lines · BlaisorBlade

Al Viro said you that ubd=mmap won't work, right? Would you give me the magic words to search on the LKML or forward the messages to the -devel list?

It was on IRC.

Quoted 7 lines

Also, I've started writing a little patch for 2.6 to hostfs to generalize it like you said (which I attached). It is just 2-3 hours of work, since I had some doubt: do you like adding a hostfs_user_operations stored into super_block->s_fs_info and calling all the functions of hostfs_user.c indirectly (the trivial and long part I did not do yet)?

Would it be useful for your "humfs", as it seems to me?

Yup, and I've already done this, with allowing any number of userspace plugins to the hostfs kernel interface, calling the ops through the operations structure, and changing hostfs and and humfs to use it.

I have humfs booting UML now, so it's close to being releasable.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Alle 20:40, lunedì 5 aprile 2004, hai scritto:

Quoted 7 lines

BTW, if you do IRC, you will have a better idea of what exactly I'm doing if you hang on the UML IRC channel - #uml on oftc.net. I'm there quite often, and I tend to mumble about what I'm working on at the moment.

Also, would you be interested in being able to put downloads on the UML site rather than having them on user-linux-linux.org, which isn't as visible?

Sorry for answering so late, but I've been away for a week, for theoretical studies in computer science. For now I must decrease my UML activity since I'll have to solve a very hard test soon; and I cannot do that myself.

However, especially for the second question, the answer is "yes".

At least for the 2.4.25 and 2.6.4 Skas patches, which are VERY important for users. Especially because there are 3 bugs in most SKAS patches floating around:
- the SMP bug we discussed about some time ago, fixed in my last release;
- this change (the one in the 2nd one) from Ingo Molnar that everyone else missed:

-static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) +static int write_ldt(struct mm_struct * mm, void __user * ptr, unsigned long bytecount, int oldmode)
{

-       struct mm_struct * mm = current->mm;
        __u32 entry_1, entry_2, *lp;
        int error;
        struct user_desc ldt_info;

@@ -195,7 +197,7 @@

        down(&mm->context.sem);
        if (ldt_info.entry_number >= mm->context.size) {
///// ---------------> NO ONE NOTICED this!
-               error = alloc_ldt(&current->mm->context,  
ldt_info.entry_number+1, 1);
+               error = alloc_ldt(&mm->context, ldt_info.entry_number+1, 1);
                if (error < 0)
                        goto out_unlock;
        }

- and finally this bug he fixed in ldt.c

- if (reload) {
+ if (reload && (&current->active_mm->context == pc)) {

They are perfectly, with only one issue: since there is CONFIG_PROC_MM in the headers, which is created by make oldconfig, but you don't have a user-visible option, user often miscompile the kernel (which then creates a "Checking for Skas3 patch ... yes Checking for /proc/mm ... no").

Also, I see no reason for which the bug with switch_mm() that involved the Skas patch in 2.6 should not happen also in 2.4; in 2.4.25 we have this check, which has never been triggered (include/asm-i386/mmu_context.h):

                if(cpu_tlbstate[cpu].active_mm != next)
                        out_of_line_bug();

So, maybe the 2.4 Skas patch could need the same change the 2.6 has in include/asm-i386/mmu_context.h.

However, please review and upload them by yourself. I'm actually busy at the moment - VERY busy.

Bye

Signature · 14 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#6 lore raw

[uml-devel] Re: [uml-user] one drawback to using cows commercially...

In reply to a message not in the archive

Alle 04:17, martedì 30 marzo 2004, Jeff Dike ha scritto:

Quoted 8 lines
Quoted 2 lines · [email protected] said:

Is there any clever way to reset the root password for users, aside from deleting the cow? "linux single" is fine, but aside from that?

I'm finishing up a new hostfs-like filesystem which I want to become the preferred mechanism to boot UMLs because of its ability to mmap data from the host, eliminating duplicate copies of file data in memory.

Quoted 6 lines

A side-effect of this is that UML filesystems will become visible on the host, so password changing would be a matter of chrooting to the filesystem and running passwd.

Currently, there is no COW functionality, but I plan to add file-level COWing with block-level COWing possibly following later.

Have you heard of the discussion about COWlinks? I.e. creating a Copy - On - Write functionality for hard links? Or do you want to rewrite files one page at a time (i.e. if I change one byte inside a file, only the "page" containing that byte is copied and changed)?

http://lwn.net/Articles/77215/

Signature · 15 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#7 lore raw

[uml-devel] Re: [uml-user] one drawback to using cows commercially...

Quoted 4 lines · [email protected] said:

Have you heard of the discussion about COWlinks? I.e. creating a Copy
- On - Write functionality for hard links? Or do you want to rewrite files one page at a time (i.e. if I change one byte inside a file, only the "page" containing that byte is copied and changed)?

COWlinks sound like they would be useful for doing file-level COWing for UML.

I'm considering that, plus block-level COWing within a file, using the standard COW format we have today. This would be necessary if we do block devices by loop-mounting a rootfs from humfs and using that as the root device.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#8 lore raw

update on cowlinks - was: Re: [uml-devel] Re: [uml-user] one drawback to using cows commercially...

In reply to BlaisorBlade

http://lwn.net/Articles/83790/
http://wohnheim.fh-wedel.de/~joern/cowlink/

----- Original Message -----
From: "BlaisorBlade" <[email protected]>
To: "Jeff Dike" <[email protected]>; "tim doyle" <[email protected]>
Cc: "UML" <[email protected]>; <[email protected]>
Sent: Sunday, April 11, 2004 4:51 PM
Subject: [uml-devel] Re: [uml-user] one drawback to using cows commercially...

Alle 04:17, martedì 30 marzo 2004, Jeff Dike ha scritto:

Quoted 8 lines
Quoted 2 lines · [email protected] said:

Is there any clever way to reset the root password for users, aside from deleting the cow? "linux single" is fine, but aside from that?

I'm finishing up a new hostfs-like filesystem which I want to become the preferred mechanism to boot UMLs because of its ability to mmap data from the host, eliminating duplicate copies of file data in memory.

Quoted 6 lines

A side-effect of this is that UML filesystems will become visible on the host, so password changing would be a matter of chrooting to the filesystem and running passwd.

Currently, there is no COW functionality, but I plan to add file-level COWing with block-level COWing possibly following later.

Have you heard of the discussion about COWlinks? I.e. creating a Copy - On - Write functionality for hard links? Or do you want to rewrite files one page at a time (i.e. if I change one byte inside a file, only the "page" containing that byte is copied and changed)?

http://lwn.net/Articles/77215/

Signature · 27 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel