* [uml-devel] Hostfs and Humfs
[not found] ` <200403300217.i2U2HKxc026892@ccure.user-mode-linux.org>
@ 2004-04-01 17:53 ` BlaisorBlade
2004-04-01 19:54 ` [uml-devel] Re: [uml-user] " Jeff Dike
[not found] ` <200404051840.i35IeHhZ029055@ccure.user-mode-linux.org>
2004-04-11 14:51 ` [uml-devel] Re: [uml-user] one drawback to using cows commercially BlaisorBlade
1 sibling, 2 replies; 6+ messages in thread
From: BlaisorBlade @ 2004-04-01 17:53 UTC (permalink / raw)
To: user-mode-linux-user, user-mode-linux-devel; +Cc: Jeff Dike
[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]
Alle 04:17, martedì 30 marzo 2004, Jeff Dike ha scritto:
> tim@unclewebster.com 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?
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
[-- Attachment #2: Abstract_hostfs.patch --]
[-- Type: text/x-diff, Size: 4870 bytes --]
--- ./fs/hostfs/hostfs_kern.c.fix 2004-03-01 18:59:47.000000000 +0100
+++ ./fs/hostfs/hostfs_kern.c 2004-03-01 19:26:03.000000000 +0100
@@ -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.fix 2004-02-20 18:43:27.000000000 +0100
+++ ./fs/hostfs/hostfs.h 2004-03-01 19:21:05.000000000 +0100
@@ -31,6 +31,7 @@
unsigned int ia_attr_flags;
};
+#if 0
extern int stat_file(const char *path, unsigned long long *inode_out,
int *mode_out, int *nlink_out, int *uid_out, int *gid_out,
unsigned long long *size_out, struct timespec *atime_out,
@@ -64,6 +65,46 @@
long long *files_out, long long *ffree_out,
void *fsid_out, int fsid_size, long *namelen_out,
long *spare_out);
+#endif
+
+struct hostfs_user_operations {
+ int (*stat_file)(const char *path, unsigned long long *inode_out,
+ int *mode_out, int *nlink_out, int *uid_out, int *gid_out,
+ unsigned long long *size_out, struct timespec *atime_out,
+ struct timespec *mtime_out, struct timespec *ctime_out,
+ int *blksize_out, unsigned long long *blocks_out);
+ int (*access_file)(char *path, int r, int w, int x);
+ int (*open_file)(char *path, int r, int w, int append);
+ int (*file_type)(const char *path, int *rdev);
+ void *(*open_dir)(char *path, int *err_out);
+ char *(*read_dir)(void *stream, unsigned long long *pos,
+ unsigned long long *ino_out, int *len_out);
+ void (*close_file)(void *stream);
+ void (*close_dir)(void *stream);
+ int (*read_file)(int fd, unsigned long long *offset, char *buf, int len);
+ int (*write_file)(int fd, unsigned long long *offset, const char *buf,
+ int len);
+ int (*lseek_file)(int fd, long long offset, int whence);
+ int (*file_create)(char *name, int ur, int uw, int ux, int gr,
+ int gw, int gx, int or, int ow, int ox);
+ int (*set_attr)(const char *file, struct hostfs_iattr *attrs);
+ int (*make_symlink)(const char *from, const char *to);
+ int (*unlink_file)(const char *file);
+ int (*do_mkdir)(const char *file, int mode);
+ int (*do_rmdir)(const char *file);
+ int (*do_mknod)(const char *file, int mode, int dev);
+ int (*link_file)(const char *from, const char *to);
+ int (*do_readlink)(char *file, char *buf, int size);
+ int (*rename_file)(char *from, char *to);
+ int (*do_statfs)(char *root, long *bsize_out, long long *blocks_out,
+ long long *bfree_out, long long *bavail_out,
+ long long *files_out, long long *ffree_out,
+ void *fsid_out, int fsid_size, long *namelen_out,
+ long *spare_out);
+};
+
+/* For now only one hostfs_user_operations can be registered */
+extern int register_hostfs_ops(struct hostfs_user_operations * ops);
#endif
--- ./fs/hostfs/hostfs_user.c.fix 2004-03-01 19:02:15.000000000 +0100
+++ ./fs/hostfs/hostfs_user.c 2004-03-01 19:25:04.000000000 +0100
@@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] Re: [uml-user] Hostfs and Humfs
2004-04-01 17:53 ` [uml-devel] Hostfs and Humfs BlaisorBlade
@ 2004-04-01 19:54 ` Jeff Dike
[not found] ` <200404051840.i35IeHhZ029055@ccure.user-mode-linux.org>
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Dike @ 2004-04-01 19:54 UTC (permalink / raw)
To: BlaisorBlade; +Cc: user-mode-linux-user, user-mode-linux-devel, Jeff Dike
On Thu, Apr 01, 2004 at 06:53:43PM +0100, BlaisorBlade wrote:
> 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.
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] Re: Hostfs and Humfs
[not found] ` <200404051840.i35IeHhZ029055@ccure.user-mode-linux.org>
@ 2004-04-09 17:54 ` BlaisorBlade
0 siblings, 0 replies; 6+ messages in thread
From: BlaisorBlade @ 2004-04-09 17:54 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel
Alle 20:40, lunedì 5 aprile 2004, hai scritto:
> 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(¤t->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 && (¤t->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
--
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_id\x1470&alloc_id638&opÌk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] Re: [uml-user] one drawback to using cows commercially...
[not found] ` <200403300217.i2U2HKxc026892@ccure.user-mode-linux.org>
2004-04-01 17:53 ` [uml-devel] Hostfs and Humfs BlaisorBlade
@ 2004-04-11 14:51 ` BlaisorBlade
2004-04-13 4:58 ` Jeff Dike
2004-05-26 23:57 ` update on cowlinks - was: " roland
1 sibling, 2 replies; 6+ messages in thread
From: BlaisorBlade @ 2004-04-11 14:51 UTC (permalink / raw)
To: Jeff Dike, tim doyle; +Cc: UML, user-mode-linux-devel
Alle 04:17, martedì 30 marzo 2004, Jeff Dike ha scritto:
> tim@unclewebster.com 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.
>
> 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/
--
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_id\x1470&alloc_id638&opÌk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [uml-devel] Re: [uml-user] one drawback to using cows commercially...
2004-04-11 14:51 ` [uml-devel] Re: [uml-user] one drawback to using cows commercially BlaisorBlade
@ 2004-04-13 4:58 ` Jeff Dike
2004-05-26 23:57 ` update on cowlinks - was: " roland
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Dike @ 2004-04-13 4:58 UTC (permalink / raw)
To: BlaisorBlade; +Cc: tim doyle, UML, user-mode-linux-devel
blaisorblade_spam@yahoo.it 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* update on cowlinks - was: Re: [uml-devel] Re: [uml-user] one drawback to using cows commercially...
2004-04-11 14:51 ` [uml-devel] Re: [uml-user] one drawback to using cows commercially BlaisorBlade
2004-04-13 4:58 ` Jeff Dike
@ 2004-05-26 23:57 ` roland
1 sibling, 0 replies; 6+ messages in thread
From: roland @ 2004-05-26 23:57 UTC (permalink / raw)
To: BlaisorBlade, Jeff Dike, tim doyle; +Cc: UML, user-mode-linux-devel
http://lwn.net/Articles/83790/
http://wohnheim.fh-wedel.de/~joern/cowlink/
----- Original Message -----
From: "BlaisorBlade" <blaisorblade_spam@yahoo.it>
To: "Jeff Dike" <jdike@addtoit.com>; "tim doyle" <tim@unclewebster.com>
Cc: "UML" <user-mode-linux-user@lists.sourceforge.net>; <user-mode-linux-devel@lists.sourceforge.net>
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:
> tim@unclewebster.com 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.
>
> 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/
--
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_id\x1470&alloc_id638&op=ick
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-05-26 23:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <40686E7D.2080600@unclewebster.com>
[not found] ` <200403300217.i2U2HKxc026892@ccure.user-mode-linux.org>
2004-04-01 17:53 ` [uml-devel] Hostfs and Humfs BlaisorBlade
2004-04-01 19:54 ` [uml-devel] Re: [uml-user] " Jeff Dike
[not found] ` <200404051840.i35IeHhZ029055@ccure.user-mode-linux.org>
2004-04-09 17:54 ` [uml-devel] " BlaisorBlade
2004-04-11 14:51 ` [uml-devel] Re: [uml-user] one drawback to using cows commercially BlaisorBlade
2004-04-13 4:58 ` Jeff Dike
2004-05-26 23:57 ` update on cowlinks - was: " roland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox