From: "wang lianwei" <lianwei.wang@gmail.com>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] UML hostfs bugs
Date: Thu, 10 Aug 2006 23:42:14 +0800 [thread overview]
Message-ID: <39134b110608100842p5acdf798o807b48801ea9a706@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1292 bytes --]
Hi all,
There is a bug with UML kernel, some host directory can not be read, for
example "ls /mnt/host/usr/lib", this command is dead until you press CTRL+c.
I test it with Redhat Enterprise Linux 4.
This is because the UML read host directory through opendir, seekdir,
readdir and telldir. When get the dir stream offset through telldir, it
always return 0 on some directory, for example".", I don't know why? But
we can fix it as follows although the next dir entry offset is not exact:
Modify the fs/hostfs/hostfs_user.c file, update the read_dir function,
char *read_dir(void *stream, unsigned long long *pos,
unsigned long long *ino_out, int *len_out)
{
DIR *dir = stream;
struct dirent *ent;
unsigned long long oldpos;
oldpos = *pos;
seekdir(dir, *pos);
ent = readdir(dir);
if(ent == NULL)
{
return(NULL);
}
*len_out = strlen(ent->d_name);
*ino_out = ent->d_ino;
*pos = telldir(dir);
/* Fix the telldir return 0 error */
if (*pos == 0)
*pos = oldpos + *len_out;
return(ent->d_name);
}
although the next offset is not exact, but the readdir can get the next
entry correct.
Can anyone give a better solution?
[-- Attachment #1.2: Type: text/html, Size: 4202 bytes --]
[-- Attachment #2: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #3: Type: text/plain, Size: 194 bytes --]
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2006-08-10 15:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 15:42 wang lianwei [this message]
2006-08-12 18:22 ` [uml-devel] UML hostfs bugs Blaisorblade
2006-08-12 20:10 ` Blaisorblade
2006-08-14 11:07 ` wang lianwei
2006-08-15 17:47 ` Blaisorblade
2006-08-16 10:19 ` wang lianwei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39134b110608100842p5acdf798o807b48801ea9a706@mail.gmail.com \
--to=lianwei.wang@gmail.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox