Re: How Linux /proc filesystem convert a fd to the actual pathname?

2007-08-21 Thread Xin Zhao
Thanks! That perfectly answered my question. -x On 8/21/07, Kevin Hao <[EMAIL PROTECTED]> wrote: > > I am curious how Linux convert an fd to the pathname? Does it > > recursively walk back from current dentry to the root? > Using d_path. > > Can someone point me to the right place in the kernel

Re: How Linux /proc filesystem convert a fd to the actual pathname?

2007-08-21 Thread Xin Zhao
Thanks! That perfectly answered my question. -x On 8/21/07, Kevin Hao [EMAIL PROTECTED] wrote: I am curious how Linux convert an fd to the pathname? Does it recursively walk back from current dentry to the root? Using d_path. Can someone point me to the right place in the kernel where

How Linux /proc filesystem convert a fd to the actual pathname?

2007-08-20 Thread Xin Zhao
Hi, In the Linux proc filesystem, /proc/[pid]/fd is a link to the actually the actual pathname of the opened file. I am curious how Linux convert an fd to the pathname? Does it recursively walk back from current dentry to the root? Can someone point me to the right place in the kernel where

How Linux /proc filesystem convert a fd to the actual pathname?

2007-08-20 Thread Xin Zhao
Hi, In the Linux proc filesystem, /proc/[pid]/fd is a link to the actually the actual pathname of the opened file. I am curious how Linux convert an fd to the pathname? Does it recursively walk back from current dentry to the root? Can someone point me to the right place in the kernel where

Re: how do versioning filesystems take snapshot of opened files?

2007-07-03 Thread Xin Zhao
to prevent a file from containing part of old data and part of new data. That's why I am so confused how can these systems provide consistent snapshotting capability without sacrificing system performance much. On 7/3/07, Chris Mason <[EMAIL PROTECTED]> wrote: On Tue, 3 Jul 2007 01:28:57 -040

Re: how do versioning filesystems take snapshot of opened files?

2007-07-03 Thread Xin Zhao
to prevent a file from containing part of old data and part of new data. That's why I am so confused how can these systems provide consistent snapshotting capability without sacrificing system performance much. On 7/3/07, Chris Mason [EMAIL PROTECTED] wrote: On Tue, 3 Jul 2007 01:28:57 -0400 Xin Zhao

Re: how do versioning filesystems take snapshot of opened files?

2007-07-02 Thread Xin Zhao
TED]> wrote: It depends how snapshot is being taken. Usually it is Copy On Write. Google for Copy on Write and you will find the answer for this. On 7/3/07, Xin Zhao <[EMAIL PROTECTED]> wrote: > > Hi, > > > If a file is already opened when snapshot command is issue

how do versioning filesystems take snapshot of opened files?

2007-07-02 Thread Xin Zhao
Hi, If a file is already opened when snapshot command is issued, the file itself could be in an inconsistent state already. Before the file is closed, maybe part of the file contains old data, the rest contains new data. How does a versioning filesystem guarantee that the file snapshot is in a

how do versioning filesystems take snapshot of opened files?

2007-07-02 Thread Xin Zhao
Hi, If a file is already opened when snapshot command is issued, the file itself could be in an inconsistent state already. Before the file is closed, maybe part of the file contains old data, the rest contains new data. How does a versioning filesystem guarantee that the file snapshot is in a

Re: how do versioning filesystems take snapshot of opened files?

2007-07-02 Thread Xin Zhao
: It depends how snapshot is being taken. Usually it is Copy On Write. Google for Copy on Write and you will find the answer for this. On 7/3/07, Xin Zhao [EMAIL PROTECTED] wrote: Hi, If a file is already opened when snapshot command is issued, the file itself could be in an inconsistent

Re: Linux page cache issue?

2007-03-29 Thread Xin Zhao
es (BTW ext3cow filesystem may be interesting for you www.ext3cow.com). Honza > On 3/28/07, Dave Kleikamp <[EMAIL PROTECTED]> wrote: > >On Wed, 2007-03-28 at 02:45 -0400, Xin Zhao wrote: > >> Hi, > >> > >> If a L

Re: Linux page cache issue?

2007-03-29 Thread Xin Zhao
). Honza On 3/28/07, Dave Kleikamp [EMAIL PROTECTED] wrote: On Wed, 2007-03-28 at 02:45 -0400, Xin Zhao wrote: Hi, If a Linux process opens and reads a file A, then it closes the file. Will Linux keep the file A's data in cache for a while in case another process

Re: Linux page cache issue?

2007-03-28 Thread Xin Zhao
You are right. If the device is very big, the radix tree could be huge as well. Maybe the lookup it not that cheap. But the per-device tree can be optimized too. A simple way I can immediately image is: evenly split a device into N parts by the sector numbers. For each part, we maintain a radix

Re: Linux page cache issue?

2007-03-28 Thread Xin Zhao
On Wed, 2007-03-28 at 02:45 -0400, Xin Zhao wrote: > Hi, > > If a Linux process opens and reads a file A, then it closes the file. > Will Linux keep the file A's data in cache for a while in case another > process opens and reads the same in a short time? I think that is what &

Re: Linux page cache issue?

2007-03-28 Thread Xin Zhao
, 2007-03-28 at 02:45 -0400, Xin Zhao wrote: Hi, If a Linux process opens and reads a file A, then it closes the file. Will Linux keep the file A's data in cache for a while in case another process opens and reads the same in a short time? I think that is what I heard before. Yes. But after I

Re: Linux page cache issue?

2007-03-28 Thread Xin Zhao
You are right. If the device is very big, the radix tree could be huge as well. Maybe the lookup it not that cheap. But the per-device tree can be optimized too. A simple way I can immediately image is: evenly split a device into N parts by the sector numbers. For each part, we maintain a radix

Linux page cache issue?

2007-03-27 Thread Xin Zhao
Hi, If a Linux process opens and reads a file A, then it closes the file. Will Linux keep the file A's data in cache for a while in case another process opens and reads the same in a short time? I think that is what I heard before. But after I digged into the kernel code, I am confused. When a

Linux page cache issue?

2007-03-27 Thread Xin Zhao
Hi, If a Linux process opens and reads a file A, then it closes the file. Will Linux keep the file A's data in cache for a while in case another process opens and reads the same in a short time? I think that is what I heard before. But after I digged into the kernel code, I am confused. When a

Re: question regarding the Linux block device cache

2007-03-09 Thread Xin Zhao
I read the code and found that a block buffer is not necessarily freed even if the corresponding inode is released. Looks like block buffer can stay around as long as the system still has free memory. Is my understanding correct? -x On 3/9/07, Xin Zhao <[EMAIL PROTECTED]> wrote: Hi,

question regarding the Linux block device cache

2007-03-09 Thread Xin Zhao
Hi, I am working on a file system that allow multiple files to share data blocks. That is, a data block can be shared by two or more files. Now my question is: suppose file A and B share the same data block D. Now a process open file A and read block D, then this process closes file A. If

question regarding the Linux block device cache

2007-03-09 Thread Xin Zhao
Hi, I am working on a file system that allow multiple files to share data blocks. That is, a data block can be shared by two or more files. Now my question is: suppose file A and B share the same data block D. Now a process open file A and read block D, then this process closes file A. If

Re: question regarding the Linux block device cache

2007-03-09 Thread Xin Zhao
I read the code and found that a block buffer is not necessarily freed even if the corresponding inode is released. Looks like block buffer can stay around as long as the system still has free memory. Is my understanding correct? -x On 3/9/07, Xin Zhao [EMAIL PROTECTED] wrote: Hi, I am

Re: [newbie] Re: Is it possible to directly call do_path_lookup() in kernel?

2007-01-24 Thread Xin Zhao
EMAIL PROTECTED]> wrote: On 2007-01-24, Xin Zhao wrote: > Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/485775> Hallo. > I just successfully called do_path_lookup() in my kernel module. I > just removed the "fastcall" from the declaration of do_path_look

Re: [newbie] Re: Is it possible to directly call do_path_lookup() in kernel?

2007-01-24 Thread Xin Zhao
-01-24, Xin Zhao wrote: Archived-At: http://permalink.gmane.org/gmane.linux.kernel/485775 Hallo. I just successfully called do_path_lookup() in my kernel module. I just removed the fastcall from the declaration of do_path_lookup(), then the problem disappeared. I don't quite understand fastcall

Re: Is it possible to directly call do_path_lookup() in kernel?

2007-01-23 Thread Xin Zhao
I just successfully called do_path_lookup() in my kernel module. I just removed the "fastcall" from the declaration of do_path_lookup(), then the problem disappeared. I don't quite understand "fastcall" though. Can someone explain it? Thanks, -x On 1/23/07, Xin Zhao <[

Is it possible to directly call do_path_lookup() in kernel?

2007-01-23 Thread Xin Zhao
Hi, I tried to call the following code in a kernel module: error = do_path_lookup(AT_FDCWD, "/etc/profile.d/glib2.csh", LOOKUP_PARENT, ); I exported the function do_path_lookup() using "EXPORT_SYMBOL_GPL(do_path_lookup);" But do_path_lookup() caused the "general protection fault:

Is it possible to directly call do_path_lookup() in kernel?

2007-01-23 Thread Xin Zhao
Hi, I tried to call the following code in a kernel module: error = do_path_lookup(AT_FDCWD, /etc/profile.d/glib2.csh, LOOKUP_PARENT, nd); I exported the function do_path_lookup() using EXPORT_SYMBOL_GPL(do_path_lookup); But do_path_lookup() caused the general protection fault:

Re: Is it possible to directly call do_path_lookup() in kernel?

2007-01-23 Thread Xin Zhao
I just successfully called do_path_lookup() in my kernel module. I just removed the fastcall from the declaration of do_path_lookup(), then the problem disappeared. I don't quite understand fastcall though. Can someone explain it? Thanks, -x On 1/23/07, Xin Zhao [EMAIL PROTECTED] wrote: Hi

How is SELinux integrated into kernel 2.6?

2005-09-08 Thread Xin Zhao
Sorry if this question is dumb. SELinux is included in 2.6. But I think it works by putting LSM hooks a lot of place in Linux and then it can define its own policy enforcement codes. However, I cannot find hooks in kernel 2.6.9 and 2.6.11. How can SELinux work with kernel 2.6 to protect system

How is SELinux integrated into kernel 2.6?

2005-09-08 Thread Xin Zhao
Sorry if this question is dumb. SELinux is included in 2.6. But I think it works by putting LSM hooks a lot of place in Linux and then it can define its own policy enforcement codes. However, I cannot find hooks in kernel 2.6.9 and 2.6.11. How can SELinux work with kernel 2.6 to protect system

Any access control mechanism that allow exceptions?

2005-08-06 Thread Xin Zhao
Hi, I want to lock down a directory to be read-only, say, /etc, for system security. Unfortunately, some valid system tools might need to create/modified files like "/etc/dhclient-eth0.conf". To avoid disrupting the normal running of those tools, I might have to allow certain files to be created

Any access control mechanism that allow exceptions?

2005-08-06 Thread Xin Zhao
Hi, I want to lock down a directory to be read-only, say, /etc, for system security. Unfortunately, some valid system tools might need to create/modified files like /etc/dhclient-eth0.conf. To avoid disrupting the normal running of those tools, I might have to allow certain files to be created

Is it possible to get the return address in a system call function?

2005-08-02 Thread Xin Zhao
Let me clarify with an example: test.c: ** open("abc.txt", O_RDONLY); i ++; Apparently, after the system call "open" in the kernel, the system will return to the instruction "i++". My question is: can we find out the instruction pointer in sys_open? If so, how? Thanks! xin - To

Is it possible to get the return address in a system call function?

2005-08-02 Thread Xin Zhao
Let me clarify with an example: test.c: ** open(abc.txt, O_RDONLY); i ++; Apparently, after the system call open in the kernel, the system will return to the instruction i++. My question is: can we find out the instruction pointer in sys_open? If so, how? Thanks! xin - To unsubscribe

Re: Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
wrote: > On Fri, Jul 29, 2005 at 05:00:20PM -0400, Xin Zhao wrote: > > Thanks for your reply. > > > > Below is the code that print the kernel calling trace: > > Can I suggest just turning on frame pointers like I suggested? > > If you say Y here the resulti

Re: Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
that the show_trace does not scan and guess the pointers. Instead, it use "previous_esp" to extract the esp and thus the returning eip. Am I right? Cheers, xin On 7/29/05, bert hubert <[EMAIL PROTECTED]> wrote: > On Fri, Jul 29, 2005 at 04:27:16PM -0400, Xin Zhao wrote: > >

Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
I tried to use dump_stack to dump the calling trace in the kernel. What I did is adding a dump_stack() call in the sys_open function. Below is the dump out result: Jul 28 17:33:31 normal kernel: [] sys_open+0xa6/0xb7 Jul 28 17:33:31 normal kernel: [] syscall_call+0x7/0xb However, if I insert

Where can I find some source code to dump user_stack?

2005-07-29 Thread Xin Zhao
I know in kernel level we have dump_stack, but is there anyway that we can dump user stack in the kernel environment? I might want to dump the calling trace in a system call function. Thanks in advance! -x - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of

Where can I find some source code to dump user_stack?

2005-07-29 Thread Xin Zhao
I know in kernel level we have dump_stack, but is there anyway that we can dump user stack in the kernel environment? I might want to dump the calling trace in a system call function. Thanks in advance! -x - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a

Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
I tried to use dump_stack to dump the calling trace in the kernel. What I did is adding a dump_stack() call in the sys_open function. Below is the dump out result: Jul 28 17:33:31 normal kernel: [c0151601] sys_open+0xa6/0xb7 Jul 28 17:33:31 normal kernel: [c0108e2c] syscall_call+0x7/0xb

Re: Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
. Instead, it use previous_esp to extract the esp and thus the returning eip. Am I right? Cheers, xin On 7/29/05, bert hubert [EMAIL PROTECTED] wrote: On Fri, Jul 29, 2005 at 04:27:16PM -0400, Xin Zhao wrote: I supprisely noticed that the dump_stack results are quite different! Why did I get

Re: Why dump_stack results different so much?

2005-07-29 Thread Xin Zhao
: On Fri, Jul 29, 2005 at 05:00:20PM -0400, Xin Zhao wrote: Thanks for your reply. Below is the code that print the kernel calling trace: Can I suggest just turning on frame pointers like I suggested? If you say Y here the resulting kernel image will be slightly larger and slower

Re: Where can I find the RPC FSM document?

2005-07-21 Thread Xin Zhao
OK. I already read the codes. But an official document is always welcome. :) On 7/21/05, Xin Zhao <[EMAIL PROTECTED]> wrote: > I'd like to learn some details of how RPC's FSM works (e.g. the > changing graph of all states). I know one possibility is to read the > source code, but

Re: Where can I find the RPC FSM document?

2005-07-21 Thread Xin Zhao
OK. I already read the codes. But an official document is always welcome. :) On 7/21/05, Xin Zhao [EMAIL PROTECTED] wrote: I'd like to learn some details of how RPC's FSM works (e.g. the changing graph of all states). I know one possibility is to read the source code, but it is a little time

Where can I find the RPC FSM document?

2005-07-20 Thread Xin Zhao
I'd like to learn some details of how RPC's FSM works (e.g. the changing graph of all states). I know one possibility is to read the source code, but it is a little time consuming. Can someone kindly direct me to some documents about the rpc implementatino? Thanks in advance! -x - To

Where can I find the RPC FSM document?

2005-07-20 Thread Xin Zhao
I'd like to learn some details of how RPC's FSM works (e.g. the changing graph of all states). I know one possibility is to read the source code, but it is a little time consuming. Can someone kindly direct me to some documents about the rpc implementatino? Thanks in advance! -x - To

NFS and RPC question under kernel 2.6

2005-07-11 Thread Xin Zhao
Sorry if this question is dumb. I am trying to modify NFS to add some more features. I changed the rpc_clnt struct in include/linux/sunrpc/clnt.h to add some more fields: vrpc_comm_t *cl_comm; wait_queue_head_t cl_callwaitq[MAX_PENDING_REQS]; int

NFS and RPC question under kernel 2.6

2005-07-11 Thread Xin Zhao
Sorry if this question is dumb. I am trying to modify NFS to add some more features. I changed the rpc_clnt struct in include/linux/sunrpc/clnt.h to add some more fields: vrpc_comm_t *cl_comm; wait_queue_head_t cl_callwaitq[MAX_PENDING_REQS]; int

Re: Why cannot I do "insmod nfsd.ko" directly?

2005-07-05 Thread Xin Zhao
nfsd.ko. How to do this? Thanks! -x On 7/5/05, Horst von Brand <[EMAIL PROTECTED]> wrote: > Xin Zhao <[EMAIL PROTECTED]> wrote: > > I tried to do "insmod nfsd.ko", but always got the error message > > "insmod: error inserting 'nfsd.ko': -1 Unknown symbol in mo

Why cannot I do "insmod nfsd.ko" directly?

2005-07-05 Thread Xin Zhao
I tried to do "insmod nfsd.ko", but always got the error message "insmod: error inserting 'nfsd.ko': -1 Unknown symbol in module" Why? The kernel is 2.6.11.10 The command I used is: 1. insmod lockd.ko ---succeed 2. exportfs -r ---succeed 3. insmod nfsd.ko --- failed Moreover, I noticed

Re: kernel 2.6: NFS problem---cannot rmmod nfsd

2005-07-05 Thread Xin Zhao
Please discard the previous message. I just noticed that something was wrong in the nfsd implementation (slightly modified by me). After I fixed the problem, I can rmmod nfsd now. Sorry for the confusion. -x On 7/5/05, Xin Zhao <[EMAIL PROTECTED]> wrote: > I compile kernel

Re: kernel 2.6: NFS problem---cannot rmmod nfsd

2005-07-05 Thread Xin Zhao
Please discard the previous message. I just noticed that something was wrong in the nfsd implementation (slightly modified by me). After I fixed the problem, I can rmmod nfsd now. Sorry for the confusion. -x On 7/5/05, Xin Zhao [EMAIL PROTECTED] wrote: I compile kernel 2.6.11.10 and configure

Why cannot I do insmod nfsd.ko directly?

2005-07-05 Thread Xin Zhao
I tried to do insmod nfsd.ko, but always got the error message insmod: error inserting 'nfsd.ko': -1 Unknown symbol in module Why? The kernel is 2.6.11.10 The command I used is: 1. insmod lockd.ko ---succeed 2. exportfs -r ---succeed 3. insmod nfsd.ko --- failed Moreover, I noticed that if

Re: Why cannot I do insmod nfsd.ko directly?

2005-07-05 Thread Xin Zhao
nfsd.ko. How to do this? Thanks! -x On 7/5/05, Horst von Brand [EMAIL PROTECTED] wrote: Xin Zhao [EMAIL PROTECTED] wrote: I tried to do insmod nfsd.ko, but always got the error message insmod: error inserting 'nfsd.ko': -1 Unknown symbol in module Use modprobe(8), it knows about module

Fedora Core 2 installation cannot recognize raid disks?

2005-04-17 Thread Xin Zhao
Sorry for this dumb question. I am trying to install Fedora Core 2 on a dell PowerEdge 2850 with three 73GB SCSI disks on a RAID 4e/DI controller. I set it up as Raid 5. but when I tried to install FC2, it always complaint that no disk drive can be found. Can anybody give me some advice on how

Re: Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
We can certainly harden the system, but sometime the vulnerability in kernel is hard to detect and protect. For example, the brk() vulnerablitiy found in Linux kernel. All the security mechanisms you mentioned have to rely on a healthy kernel. Unfortunately, the kernel itself could be compromised

Re: Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
silly mistakes? Xin On 4/17/05, Willy Tarreau <[EMAIL PROTECTED]> wrote: > On Sun, Apr 17, 2005 at 11:54:34AM -0400, Xin Zhao wrote: > > Why not simply unset the write bit for all three groups of users? > > That seems to be enough to prevent file modification. > > > >

Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
Why not simply unset the write bit for all three groups of users? That seems to be enough to prevent file modification. Immutable seems to only add one more protection level in case of misconfiguration on standard access right bits. Is that right? - To unsubscribe from this list: send the line

Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
Why not simply unset the write bit for all three groups of users? That seems to be enough to prevent file modification. Immutable seems to only add one more protection level in case of misconfiguration on standard access right bits. Is that right? - To unsubscribe from this list: send the line

Re: Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
silly mistakes? Xin On 4/17/05, Willy Tarreau [EMAIL PROTECTED] wrote: On Sun, Apr 17, 2005 at 11:54:34AM -0400, Xin Zhao wrote: Why not simply unset the write bit for all three groups of users? That seems to be enough to prevent file modification. Immutable seems to only add one more

Re: Why Ext2/3 needs immutable attribute?

2005-04-17 Thread Xin Zhao
We can certainly harden the system, but sometime the vulnerability in kernel is hard to detect and protect. For example, the brk() vulnerablitiy found in Linux kernel. All the security mechanisms you mentioned have to rely on a healthy kernel. Unfortunately, the kernel itself could be compromised

Fedora Core 2 installation cannot recognize raid disks?

2005-04-17 Thread Xin Zhao
Sorry for this dumb question. I am trying to install Fedora Core 2 on a dell PowerEdge 2850 with three 73GB SCSI disks on a RAID 4e/DI controller. I set it up as Raid 5. but when I tried to install FC2, it always complaint that no disk drive can be found. Can anybody give me some advice on how

NFS2 question, help, pls!

2005-04-12 Thread Xin Zhao
I have very very fast network and is testing NFS2 over this kind of network. I noticed that for standard work like read/write a large file, compile kernels, the performance of NFS2 is good. But if I try to decompress kernel tar file. The standard ext2 takes 28s while NFS2 takes 81s. Also, if I

NFS2 question, help, pls!

2005-04-12 Thread Xin Zhao
I have very very fast network and is testing NFS2 over this kind of network. I noticed that for standard work like read/write a large file, compile kernels, the performance of NFS2 is good. But if I try to decompress kernel tar file. The standard ext2 takes 28s while NFS2 takes 81s. Also, if I

Why is NFS write so slow?

2005-03-21 Thread Xin Zhao
Sorry for the dumb question. I am trying to develop a new filesystem based on NFS, which runs in a very fast network environment. I used the source code of NFS2, but noticed that NFS write is very slow. Even if I changed wsize to 8192, it still can only reach 1MB/s. I don't know why. Because the

Why is NFS write so slow?

2005-03-21 Thread Xin Zhao
Sorry for the dumb question. I am trying to develop a new filesystem based on NFS, which runs in a very fast network environment. I used the source code of NFS2, but noticed that NFS write is very slow. Even if I changed wsize to 8192, it still can only reach 1MB/s. I don't know why. Because the