From 77a64a11077c0754f7916c626777b22b425c5ed4 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 19 Dec 2007 23:16:59 +0100 Subject: hurd/translator/tmpfs/notes_bing: New; retrieved from . --- hurd/translator/tmpfs/notes_bing.mdwn | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 hurd/translator/tmpfs/notes_bing.mdwn (limited to 'hurd/translator/tmpfs') diff --git a/hurd/translator/tmpfs/notes_bing.mdwn b/hurd/translator/tmpfs/notes_bing.mdwn new file mode 100644 index 00000000..b28611f2 --- /dev/null +++ b/hurd/translator/tmpfs/notes_bing.mdwn @@ -0,0 +1,82 @@ +1. to run tmpfs as a regular user, /servers/default-pager must be executable by that user. by default it seems to be set to read/write. +$ sudo chmod ugo+x /servers/default-pager + +Then I get this error: +tmpfs: /build/mbanck/hurd-20060825/build-tree/hurd/tmpfs/dir.c:62: diskfs_get_directs: Assertion `__builtin_offsetof (struct tmpfs_dirent, name) >= __builtin_offsetof (struct dirent, d_name)' failed. + +2. i rearranged the struct tempfs_dirent in tmpfs.h to line up with the struct dirent. now the assert passes at line 62 of dir.c passes. + struct tmpfs_dirent + { + struct tmpfs_dirent *next; + struct disknode *dn; ++ char padding[3]; + uint8_t namelen; + char name[0]; + }; + +now ls works on an empty directory. +you can touch files, and run `ls' on them. +mkdir, rmdir works too. +fsysopts works +df works + +3. creating a symlink fails. + +old patch to get symlinks working: +http://www.mail-archive.com/bug-hurd@gnu.org/msg11844.html +--- node.c.orig 2005-07-24 09:56:39.000000000 -0400 ++++ node.c 2005-07-24 09:55:46.000000000 -0400 +@@ -330,6 +330,7 @@ + create_symlink_hook (struct node *np, const char *target) + { + assert (np->dn->u.lnk == 0); ++ np->dn_stat.st_size = strlen (target); + if (np->dn_stat.st_size > 0) + { + const size_t size = np->dn_stat.st_size + 1; +@@ -337,6 +338,7 @@ + if (np->dn->u.lnk == 0) + return ENOSPC; + memcpy (np->dn->u.lnk, target, size); ++ np->dn->type = DT_LNK; + adjust_used (size); + recompute_blocks (np); + } +@@ -380,8 +382,6 @@ + error_t + diskfs_truncate (struct node *np, off_t size) + { +- if (np->allocsize <= size) +- return 0; + + if (np->dn->type == DT_LNK) + { +@@ -392,6 +392,9 @@ + return 0; + } + ++ if (np->allocsize <= size) ++ return 0; ++ + assert (np->dn->type == DT_REG); + + if (default_pager == MACH_PORT_NULL) + +now symlinks work. + +4. can't write data to a file + + +-- +miscellaneous notes: + +diskfs_disk_name could be NULL, but it is "swap" + +using default_pager_object_set_size (np->dn->u.reg.memobj, size); to truncate and grow. + +why are our blocks 512? shouldn't it something else? or at least settable? +or does libdiskfs demand this? + +diskfs_get_filemap_pager_struct (struct node *np) returns null. +shouldn't it return default_pager? +--- -- cgit v1.2.3