* drivers/video/sis horribly broken in 2.5.51
From: Willem Riede @ 2002-12-11 3:33 UTC (permalink / raw)
To: linux-kernel
Linux 2.5.51 appears to have horribly broken the files in
drivers/video/sis. linux-2.5.51/drivers/video/sis/sis_main.c
refers to #include <video/fbcon.h>, <video/fbcon-cfb8.h>,
<video/fbcon-cfb16.h>, <video/fbcon-cfb24.h>, <video/fbcon-cfb32.h>
which appears to have been removed from the tree. And who knows
what other havoc has been created :-(
Does anyone know how to fix this?
Thanks, Willem Riede.
^ permalink raw reply
* [parisc-linux] Kernel crash when loggin in via ssh
From: M. Grabert @ 2002-12-11 3:24 UTC (permalink / raw)
To: parisc-linux
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1268 bytes --]
Hi parisc-linux,
I tried to upgrade my C240 (from old 2.4.19-pa2) to linux-2.4.20-pa10 and
linux-2.4.20-pa13 (compiled with gcc-3.2.2-pre). Both new kernels boot
up fine, all daemons/programms seem to work, even network is up, but the
C240 (beast) instantly hangs after I try to ssh into the beast from my
Intel laptop (bucephalas).
Both systems (PA-RISC and Intel) are debian/sid, apt-get upgraded on Dec 8.
I tried the following on the laptop:
==
bucephalas:/home/xam/parisc# ssh xam@beast
xam@beast's password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
==
The ssh authenification is obviously successful, but I won't get a shell prompt
since the C240 crashes immediately after the login.
It works when booting the old linux-2.4.19-pa2, so there must be a bug
introduced between 2.4.19-pa2 and 2.4.20-pa10.
Attached are the kernel stack/register dump and parts of the System.map
when running linux-2.4.20-pa13.
I didn't include the kernel config since it is quite large, but the only
thing that has changed is that I use SYM2 instead of SYM1 on 2.4.20-pa13.
The config of 2.4.20-pa10 (not working) and 2.4.19-pa7 (working) is the
same, and it hasn't changed for quite a while since before that and always
worked.
greetings max
[-- Attachment #2: Type: TEXT/PLAIN, Size: 1916 bytes --]
excerpt from System.map-2.4.20-pa13:
(kernel crashes after trying to do a ssh login from laptop to C240,
after successful authentification)
10126da8 t set_user
10126e44 T sys_setreuid
10126fec T sys_setuid
101270f8 T sys_setresuid
101272a0 T sys_getresuid
10127340 T sys_setresgid
10127450 T sys_getresgid
101274f0 T sys_setfsuid
101275d8 T sys_setfsgid
1012765c T sys_times
10127698 T sys_setpgid
1012779c T sys_getpgid
1019793c t initialize_tty_struct
10197a74 T tty_default_put_char
10197aa4 T tty_register_devfs
10197aa8 T tty_unregister_devfs
10197aac T tty_register_driver
10197b94 T tty_unregister_driver
10197cfc T tty_paranoia_check
10197d7c t do_tty_write
10197f34 t check_unthrottle
10197f8c t reset_buffer_flags
10197fe4 T n_tty_flush_buffer
10198034 T n_tty_chars_in_buffer
10198078 t opost
10198234 t opost_block
10198424 t echo_char
101984bc t eraser
101988dc t n_tty_receive_room
10198908 t n_tty_write_wakeup
10198954 t n_tty_receive_buf
10198d38 T is_ignored
10198d84 t n_tty_set_termios
10199178 t n_tty_close
101991b4 t n_tty_open
10199254 t read_chan
101998d8 t write_chan
10199b44 t normal_poll
10199cdc t put_tty_queue
10199d24 t n_tty_receive_char
1019a3d8 t copy_from_read_buf
1019a4a0 T tty_wait_until_sent
1019a5b4 t unset_locked_termios
1019a6ac t change_termios
1019a8a4 t set_termios
1019aa48 t get_termio
1019ab60 t inq_canon
1019abcc T send_prio_char
1019ac5c T n_tty_ioctl
1019b0d0 T raw_open
1019b2bc T raw_release
1019b378 T raw_ioctl
1019b3dc T raw_ctl_ioctl
1019b664 T raw_read
1019b698 T raw_write
1019b6cc t rw_raw_dev
1019b9f0 t pty_close
1019bb30 t pty_unthrottle
1019bba8 t pty_write
1019bd54 t pty_write_room
1019bd94 t pty_chars_in_buffer
1019bdf8 t pty_get_device_number
1019be40 t pty_set_lock
1019beb4 t pty_bsd_ioctl
1019befc t pty_unix98_ioctl
1019bf48 t pty_flush_buffer
1019bfb8 t pty_open
[-- Attachment #3: Type: TEXT/PLAIN, Size: 1995 bytes --]
PING bucephalas.ucc.ie (143.239.201.200): 56 data bytes
64 bytes from 143.239.201.200: icmp_seq=0 ttl=64 time=0.6 ms
64 bytes from 143.239.201.200: icmp_seq=1 ttl=64 time=0.1 ms
--- bucephalas.ucc.ie ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.3/0.6 ms
beast:/etc/rcS.d#
Stack Dump:
2d072fc0: 0004070f 4c4c4c4c 4c4c4c4c 4c4c4c4c
2d072fb0: 4c4c4c4c 4c4c4c4c 4c4c4c4c 4c4c4c4c
2d072fa0: 4c4c4c4c 4c4c4c4c 4c4c4c4c 4c4c4c4c
2d072f90: 4c4c4c4c 4c4c4c4c 4c4c4c4c 4c4c4c4c
2d072f80: 4c4c4c4c 4c4c4c4c 4c4c4c4c 4c4c4c4c
2d072f70: 4c4c4c4c 4c4c4c4c 4c4c4c4c 4c4c4c4c
Kernel addresses on the stack:
[<1019bd4c>] [<10197a98>] [<1019813c>] [<10198470>]
[<10199e40>] [<101989ec>] [<1019bd4c>] [<10197a98>]
[<1019813c>] [<10198470>] [<10199e40>] [<101989ec>]
[<1019bd4c>] [<10197a98>] [<1019813c>] [<10198470>]
[<10199e40>] [<101989ec>] [<1019bd4c>] [<10197a98>]
[<1019813c>] [<10198470>] [<10199e40>] [<101989ec>]
[<1019bd4c>] [<10197a98>] [<1019813c>] [<10198470>]
[<10199e40>] [<101989ec>] [<1019bd4c>] [<10197a98>]
[<1019813c>] [<10198470>] [<10199e40>] [<101989ec>]
[<1019bd4c>]
Kernel Fault: Code=6 regs=2d072fc0 (Addr=4c4c4c4c)
YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001000000011100001111 Not tainted
r00-03 00000000 00000000 4c4c4c4c 2fd99000
r04-07 2f1ee000 00000001 2d072f08 2fd99000
r08-11 00000001 00000000 00000000 0008b660
r12-15 2fd9996c 2d04c6d0 00069d9c 00069d9c
r16-19 00000004 00069d9c 00000004 0000007f
r20-23 ffffffff 00000001 00000000 00000001
r24-27 2f46b740 00000000 2f1ee000 1027e010
r28-31 00001000 00000031 2d072fc0 10197a98
sr0-3 00000000 00000075 00000000 00000075
sr4-7 00000000 00000000 00000000 00000000
IASQ: 00000000 00000000 IAOQ: 4c4c4c4c 4c4c4c50
IIR: 43ffff80 ISR: 08030258 IOR: 34030100
CPU: 0 CR30: 2d04c000 CR31: 10320000
ORIG_R28: 6bd33fc1
^ permalink raw reply
* Re: soundcard matrix: broken links etc.
From: Patrick Shirkey @ 2002-12-11 2:52 UTC (permalink / raw)
To: John S. Denker; +Cc: goemon, alsa-devel
In-Reply-To: <3DF66A89.5030403@monmouth.com>
John S. Denker wrote:
> Hi --
>
> The soundcard matrix needs attention.
> http://www.alsa-project.org/~goemon/
>
This version is now deprecated. How did you get access to it? I noticed
the other day that google search for ALSA lists this page as second.
We should make the index for geomon point to it too. Jaroslav or Dan can
you do that?
If it was through a link on the site I will squash it.
--
Patrick Shirkey - Boost Hardware Ltd.
For the discerning hardware connoisseur
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================
Being on stage with the band in front of crowds shouting, "Get off! No!
We want normal music!", I think that was more like acting than anything
I've ever done.
Goldie, 8 Nov, 2002
The Scotsman
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
^ permalink raw reply
* Re: IBM spamms me with error messages
From: David S. Miller @ 2002-12-11 3:24 UTC (permalink / raw)
To: Matti Aarnio; +Cc: Pavel Machek, kernel list
In-Reply-To: <20021210224325.GE32122@mea-ext.zmailer.org>
On Tue, 2002-12-10 at 14:43, Matti Aarnio wrote:
> > 501 5.1.8 <@RCHGATE.RCHLAND.IBM.COM:PAVEL@INTERNET.RSCS>... Domain of
> > sender address PAVEL@INTERNET.RSCS does not exist
>
> Tinglett isn't subscribed. Yet the message is quite fresh...
It's some exploder that ends up at these people's addresses.
This is why we require help of IBM's postmasters to resolve this.
^ permalink raw reply
* Re: IBM spamms me with error messages
From: David S. Miller @ 2002-12-11 3:20 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
In-Reply-To: <20021210205611.GH20049@atrey.karlin.mff.cuni.cz>
On Tue, 2002-12-10 at 12:56, Pavel Machek wrote:
> I replied to some mail on l-k and IBM spammed me with 20+ error
> messages. Now it is apparently going to do that again.
>
> IBM: I asked your postmasters to fix your mail systems, and you
> apparently don't know how to do that. Can you fix it?!
Pavel, you're not the only person seeing this, and you're
certainly not the only one sending emails to IBM's postmasters
asking them to fix this.
The lack of any response or actions by IBM's postmasters is certainly
quite disturbing. Is there that much red tape at the company? :-)
^ permalink raw reply
* Re: "bio too big" error
From: Andrew Morton @ 2002-12-11 2:44 UTC (permalink / raw)
To: Wil Reichert, Jens Axboe; +Cc: linux-kernel
In-Reply-To: <1039572597.459.82.camel@darwin>
Wil Reichert wrote:
>
> Hi,
>
> I'm getting a "bio too big" error with 2.5.50. I've got a 330G lvm2
> partition formatted with ext3 using the -T largefile4 parameter.
> Everything seems ok at first, but any sort of access will die very
> unhappily with said error messsage after about 10 seconds of operation
> or so. The only google search results are the patch submission. Eeek.
>
How odd.
Please send the full diagnostic output.
And add this:
--- 25/drivers/block/ll_rw_blk.c~a Tue Dec 10 18:42:54 2002
+++ 25-akpm/drivers/block/ll_rw_blk.c Tue Dec 10 18:43:13 2002
@@ -1921,6 +1921,7 @@ end_io:
bdevname(bio->bi_bdev),
bio_sectors(bio),
q->max_sectors);
+ dump_stack();
goto end_io;
}
_
^ permalink raw reply
* Re: possible cache aliasing problem with O_DIRECT?
From: Jun Sun @ 2002-12-11 2:32 UTC (permalink / raw)
To: linux-kernel, linux-mips; +Cc: jsun
In-Reply-To: <20021210182051.X8642@mvista.com>
[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]
... forgot the attachment, possibly due to the same memory
corruption problem. :-)
Also, the problem is discovered in 2.4.18. I checked with 2.4.19
and it appears it should be there as well.
Jun
On Tue, Dec 10, 2002 at 06:20:51PM -0800, Jun Sun wrote:
>
> I am chasing a problem which might be a cache aliasing problem
> when a disk file is opened with O_DIRECT flag.
>
> I attached the source code of two programs. One generates a binary file
> and the other opens the file with O_DIRECT and reads it. It checks
> the content of the file while reading it.
>
> I tested this on a MIPS board with NEC vr5432 CPU, which has a
> virtually indexed, two-way set associative d-cache, and can easily
> re-produce the data corruption problem.
>
> I attached a patch which apparently solves the problem.
>
> I am not an expert in fs and mm, but my guess is:
>
> 1) user process allocates a big buffer
> 2) the user buffer is mapped into kernel virtual space for doing direct IO
> through map_user_kiobuf()
> 3) since the virtual address for buffer area is different in user space
> from that in kernel virtual, kernel should do a flush cache for those
> pages after doing the IO. That is why my attached patch makes it work.
>
> Does this make sense?
>
> However, I still have some puzzles. For it to work completely, another
> cache flushing needs to be done for the address range of the buffer in user
> space. I thought this should be done some where inside map_user_kiobuf()
> but could not find it anywhere. Did I miss it? Or it just happens to work
> even without it?
>
> Another puzzling part is that I also tested the program on another couple
> of MIPS boards which *should* suffer from this problem, but failed to
> re-produce it.
>
> Any thoughts?
>
> Jun
>
[-- Attachment #2: gen-file.c --]
[-- Type: text/plain, Size: 565 bytes --]
/*
* generate a binary file with 33554432/4 32-bit integers. The
* integers range from 0 to 33554432/4-1.
*
* This file is used by my-diotest.c.
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define TOTAL_SIZE 33554432
main()
{
int intsize=TOTAL_SIZE/4;
int f;
int i;
int ret;
assert(sizeof(i) == 4);
f=open("srcdata-ordered", O_RDWR | O_CREAT);
assert(f > 0);
for (i=0; i< intsize; i++) {
ret=write(f, &i, sizeof(i));
assert(ret == sizeof(i));
}
close(f);
}
[-- Attachment #3: my-diotest.c --]
[-- Type: text/plain, Size: 1402 bytes --]
/*
* test program to demonstrate possible cache aliasing problem with O_DRECT
* option on IDE files.
*
* Problem exists on NEC rochopper boards with vr5432/vr5500 CPUs. However
* it did not show up with vr4131 cpu and toshiba CPUs, which is unexpected.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define IOSIZE 32768
void *aligned_alloc(int size, int align)
{
void *p = malloc(size + align);
return (void*) (((unsigned)p + align-1) / align * align);
}
void check_buffer(char *p, int round)
{
int *q= (int*)p;
int intsize = IOSIZE / 4;
int i;
int base=round*intsize;
for (i=0; i< intsize; i++, q++)
if (*q != base+i)
printf("error at (%d, %d): got %d, expect %d\n",
round, i, *q, base+i);
}
void dcp(int sfd)
{
int zfd;
int r, w;
char *p;
int round=0;
#if 0
zfd = open("/dev/zero", O_RDWR);
p = mmap(NULL, IOSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, zfd, 0);
close(zfd);
#endif
p = aligned_alloc(IOSIZE, 4096);
printf("buffer alloced/mapped to memory area: %x\n", p);
while (1) {
memset(p, 0, IOSIZE);
r = read(sfd, p, IOSIZE);
if (r <= 0) break;
check_buffer(p, round);
round++;
}
}
int
main(int argc, char *argv[])
{
int sfd;
int ret;
sfd = open(argv[1], O_RDONLY | O_DIRECT);
printf ("sfd ret = %d\n", sfd);
dcp(sfd);
return 0;
}
[-- Attachment #4: o_direct-cache-flush.patch --]
[-- Type: text/plain, Size: 534 bytes --]
diff -Nru mm/filemap.c.orig mm/filemap.c
--- mm/filemap.c.orig Mon Dec 9 18:27:41 2002
+++ mm/filemap.c Tue Dec 10 17:13:41 2002
@@ -1550,9 +1550,13 @@
retval = mapping->a_ops->direct_IO(rw, inode, iobuf, (offset+progress) >> blocksize_bits, blocksize);
- if (rw == READ && retval > 0)
+ if (rw == READ && retval > 0) {
+ int i;
+ for (i=0; i< iobuf->nr_pages; i++)
+ flush_page_to_ram(iobuf->maplist[i]);
mark_dirty_kiobuf(iobuf, retval);
-
+ }
+
if (retval >= 0) {
count -= retval;
buf += retval;
^ permalink raw reply
* possible cache aliasing problem with O_DIRECT?
From: Jun Sun @ 2002-12-11 2:20 UTC (permalink / raw)
To: linux-kernel, linux-mips; +Cc: jsun
I am chasing a problem which might be a cache aliasing problem
when a disk file is opened with O_DIRECT flag.
I attached the source code of two programs. One generates a binary file
and the other opens the file with O_DIRECT and reads it. It checks
the content of the file while reading it.
I tested this on a MIPS board with NEC vr5432 CPU, which has a
virtually indexed, two-way set associative d-cache, and can easily
re-produce the data corruption problem.
I attached a patch which apparently solves the problem.
I am not an expert in fs and mm, but my guess is:
1) user process allocates a big buffer
2) the user buffer is mapped into kernel virtual space for doing direct IO
through map_user_kiobuf()
3) since the virtual address for buffer area is different in user space
from that in kernel virtual, kernel should do a flush cache for those
pages after doing the IO. That is why my attached patch makes it work.
Does this make sense?
However, I still have some puzzles. For it to work completely, another
cache flushing needs to be done for the address range of the buffer in user
space. I thought this should be done some where inside map_user_kiobuf()
but could not find it anywhere. Did I miss it? Or it just happens to work
even without it?
Another puzzling part is that I also tested the program on another couple
of MIPS boards which *should* suffer from this problem, but failed to
re-produce it.
Any thoughts?
Jun
^ permalink raw reply
* Re: [BK prob] - bogus cset
From: Alex Goddard @ 2002-12-10 21:28 UTC (permalink / raw)
To: Larry McVoy; +Cc: linux-kernel
In-Reply-To: <20021210174253.A29772@work.bitmover.com>
On Tue, 10 Dec 2002, Larry McVoy wrote:
> By the way, the set of people who need to clean up are:
>
> agoddard
I hadn't done any mucking around today, just pulled because I'd forgotten
Linus was off travelling and wouldn't be merging anything, so no harm
done.
Thanks for being up front and quick about what happened.
[Snip]
--
Alex Goddard
agoddard@purdue.edu
^ permalink raw reply
* [PATCH 2.4.21-pre1] Dcache Fastwalk
From: Hanna Linder @ 2002-12-11 2:31 UTC (permalink / raw)
To: marcelo; +Cc: hannal, hch, viro, linux-kernel
Hi Marcelo,
This patch is a backport of the work Al Viro and I did
in 2.5 to decrease cacheline bouncing during dcache lookup. This
also removes path_init and replaces it with path_lookup (hence
the changes in intermezzo and nfsd) as it is in 2.5.
Please consider this for inclusion in the next 2.4.2* release.
This patch is no different than the 2.4.20 patch, it simply applies
with no fuzz.
Thanks.
Hanna Linder
IBM Linux Technology Center
-------
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/dcache.c linux-fastwalk/fs/dcache.c
--- linux-2.4.21-pre1/fs/dcache.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/dcache.c Tue Dec 10 18:19:25 2002
@@ -702,13 +702,25 @@
struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
{
+ struct dentry *dentry = NULL;
+
+ spin_lock(&dcache_lock);
+ dentry = __d_lookup(parent,name);
+ if (dentry)
+ __dget_locked(dentry);
+ spin_unlock(&dcache_lock);
+ return dentry;
+}
+
+struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
+{
+
unsigned int len = name->len;
unsigned int hash = name->hash;
const unsigned char *str = name->name;
struct list_head *head = d_hash(parent,hash);
struct list_head *tmp;
- spin_lock(&dcache_lock);
tmp = head->next;
for (;;) {
struct dentry * dentry = list_entry(tmp, struct dentry, d_hash);
@@ -728,12 +740,9 @@
if (memcmp(dentry->d_name.name, str, len))
continue;
}
- __dget_locked(dentry);
dentry->d_vfs_flags |= DCACHE_REFERENCED;
- spin_unlock(&dcache_lock);
return dentry;
}
- spin_unlock(&dcache_lock);
return NULL;
}
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/intermezzo/journal.c linux-fastwalk/fs/intermezzo/journal.c
--- linux-2.4.21-pre1/fs/intermezzo/journal.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/journal.c Tue Dec 10 18:19:25 2002
@@ -617,8 +617,7 @@
CDEBUG(D_CACHE, "looking up: %s\n", path);
- if (path_init(path, LOOKUP_PARENT, nd))
- error = path_walk(path, nd);
+ error = path_lookup(path, LOOKUP_PARENT, nd);
if (error) {
EXIT;
return error;
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/intermezzo/presto.c linux-fastwalk/fs/intermezzo/presto.c
--- linux-2.4.21-pre1/fs/intermezzo/presto.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/presto.c Tue Dec 10 18:19:25 2002
@@ -53,8 +53,7 @@
ENTRY;
err = 0;
- if (path_init(name, flags, nd))
- err = path_walk(name, nd);
+ err = path_lookup(name, flags, nd);
return err;
}
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/intermezzo/vfs.c linux-fastwalk/fs/intermezzo/vfs.c
--- linux-2.4.21-pre1/fs/intermezzo/vfs.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/vfs.c Tue Dec 10 18:19:25 2002
@@ -702,8 +702,7 @@
/* this looks up the parent */
// if (path_init(pathname, LOOKUP_FOLLOW | LOOKUP_POSITIVE, &nd))
- if (path_init(pathname, LOOKUP_PARENT, &nd))
- error = path_walk(pathname, &nd);
+ error = path_lookup(pathname, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit;
@@ -855,12 +854,10 @@
struct nameidata nd, old_nd;
error = 0;
- if (path_init(from, LOOKUP_POSITIVE, &old_nd))
- error = path_walk(from, &old_nd);
+ error = path_lookup(from, LOOKUP_POSITIVE, &old_nd);
if (error)
goto exit;
- if (path_init(to, LOOKUP_PARENT, &nd))
- error = path_walk(to, &nd);
+ error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error)
goto out;
error = -EXDEV;
@@ -1062,8 +1059,7 @@
if(IS_ERR(name))
return PTR_ERR(name);
- if (path_init(name, LOOKUP_PARENT, &nd))
- error = path_walk(name, &nd);
+ error = path_lookup(name, LOOKUP_PARENT, &nd);
if (error)
goto exit;
error = -EISDIR;
@@ -1223,8 +1219,7 @@
goto exit_from;
}
- if (path_init(to, LOOKUP_PARENT, &nd))
- error = path_walk(to, &nd);
+ error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit_to;
@@ -1381,8 +1376,7 @@
return error;
}
- if (path_init(pathname, LOOKUP_PARENT, &nd))
- error = path_walk(pathname, &nd);
+ error = path_lookup(pathname, LOOKUP_PARENT, &nd);
if (error)
goto out_name;
@@ -1527,8 +1521,7 @@
return PTR_ERR(name);
}
- if (path_init(name, LOOKUP_PARENT, &nd))
- error = path_walk(name, &nd);
+ error = path_lookup(name, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit;
@@ -1693,8 +1686,7 @@
if (IS_ERR(tmp))
return PTR_ERR(tmp);
- if (path_init(tmp, LOOKUP_PARENT, &nd))
- error = path_walk(tmp, &nd);
+ error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
dentry = lookup_create(&nd, 0);
@@ -1973,14 +1965,11 @@
ENTRY;
- if (path_init(oldname, LOOKUP_PARENT, &oldnd))
- error = path_walk(oldname, &oldnd);
-
+ error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
if (error)
goto exit;
- if (path_init(newname, LOOKUP_PARENT, &newnd))
- error = path_walk(newname, &newnd);
+ error = path_lookup(newname, LOOKUP_PARENT, &newnd);
if (error)
goto exit1;
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/namei.c linux-fastwalk/fs/namei.c
--- linux-2.4.21-pre1/fs/namei.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/namei.c Tue Dec 10 18:19:25 2002
@@ -263,7 +263,7 @@
static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
{
struct dentry * dentry = d_lookup(parent, name);
-
+
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
dput(dentry);
@@ -273,6 +273,61 @@
return dentry;
}
+/*for fastwalking*/
+static inline void unlock_nd(struct nameidata *nd)
+{
+ struct vfsmount *mnt = nd->old_mnt;
+ struct dentry *dentry = nd->old_dentry;
+ mntget(nd->mnt);
+ dget_locked(nd->dentry);
+ nd->old_mnt = NULL;
+ nd->old_dentry = NULL;
+ spin_unlock(&dcache_lock);
+ dput(dentry);
+ mntput(mnt);
+}
+
+static inline void lock_nd(struct nameidata *nd)
+{
+ spin_lock(&dcache_lock);
+ nd->old_mnt = nd->mnt;
+ nd->old_dentry = nd->dentry;
+}
+
+/*
+ * Short-cut version of permission(), for calling by
+ * path_walk(), when dcache lock is held. Combines parts
+ * of permission() and vfs_permission(), and tests ONLY for
+ * MAY_EXEC permission.
+ *
+ * If appropriate, check DAC only. If not appropriate, or
+ * short-cut DAC fails, then call permission() to do more
+ * complete permission check.
+ */
+static inline int exec_permission_lite(struct inode *inode)
+{
+ umode_t mode = inode->i_mode;
+
+ if ((inode->i_op && inode->i_op->permission))
+ return -EAGAIN;
+
+ if (current->fsuid == inode->i_uid)
+ mode >>= 6;
+ else if (in_group_p(inode->i_gid))
+ mode >>= 3;
+
+ if (mode & MAY_EXEC)
+ return 0;
+
+ if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
+ return 0;
+
+ if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
+ return 0;
+
+ return -EACCES;
+}
+
/*
* This is called when everything else fails, and we actually have
* to go to the low-level filesystem to find out what we should do..
@@ -354,10 +409,10 @@
return -ELOOP;
}
-static inline int __follow_up(struct vfsmount **mnt, struct dentry **base)
+int follow_up(struct vfsmount **mnt, struct dentry **dentry)
{
struct vfsmount *parent;
- struct dentry *dentry;
+ struct dentry *mountpoint;
spin_lock(&dcache_lock);
parent=(*mnt)->mnt_parent;
if (parent == *mnt) {
@@ -365,18 +420,27 @@
return 0;
}
mntget(parent);
- dentry=dget((*mnt)->mnt_mountpoint);
+ mountpoint=dget((*mnt)->mnt_mountpoint);
spin_unlock(&dcache_lock);
- dput(*base);
- *base = dentry;
+ dput(*dentry);
+ *dentry = mountpoint;
mntput(*mnt);
*mnt = parent;
return 1;
}
-int follow_up(struct vfsmount **mnt, struct dentry **dentry)
+static int follow_mount(struct vfsmount **mnt, struct dentry **dentry)
{
- return __follow_up(mnt, dentry);
+ int res = 0;
+ while (d_mountpoint(*dentry)) {
+ struct vfsmount *mounted = lookup_mnt(*mnt, *dentry);
+ if (!mounted)
+ break;
+ *mnt = mounted;
+ *dentry = mounted->mnt_root;
+ res = 1;
+ }
+ return res;
}
static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry)
@@ -402,41 +466,83 @@
return __follow_down(mnt,dentry);
}
-static inline void follow_dotdot(struct nameidata *nd)
+static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
{
while(1) {
struct vfsmount *parent;
- struct dentry *dentry;
- read_lock(¤t->fs->lock);
- if (nd->dentry == current->fs->root &&
- nd->mnt == current->fs->rootmnt) {
- read_unlock(¤t->fs->lock);
+ if (*dentry == current->fs->root &&
+ *mnt == current->fs->rootmnt)
break;
- }
- read_unlock(¤t->fs->lock);
- spin_lock(&dcache_lock);
- if (nd->dentry != nd->mnt->mnt_root) {
- dentry = dget(nd->dentry->d_parent);
- spin_unlock(&dcache_lock);
- dput(nd->dentry);
- nd->dentry = dentry;
+ if (*dentry != (*mnt)->mnt_root) {
+ *dentry = (*dentry)->d_parent;
break;
}
- parent=nd->mnt->mnt_parent;
- if (parent == nd->mnt) {
- spin_unlock(&dcache_lock);
+ parent=(*mnt)->mnt_parent;
+ if (parent == *mnt)
break;
- }
- mntget(parent);
- dentry=dget(nd->mnt->mnt_mountpoint);
- spin_unlock(&dcache_lock);
- dput(nd->dentry);
- nd->dentry = dentry;
- mntput(nd->mnt);
- nd->mnt = parent;
+ *dentry=(*mnt)->mnt_mountpoint;
+ *mnt = parent;
}
- while (d_mountpoint(nd->dentry) && __follow_down(&nd->mnt, &nd->dentry))
- ;
+ follow_mount(mnt, dentry);
+}
+
+struct path {
+ struct vfsmount *mnt;
+ struct dentry *dentry;
+};
+
+/*
+ * It's more convoluted than I'd like it to be, but... it's still fairly
+ * small and for now I'd prefer to have fast path as straight as possible.
+ * It _is_ time-critical.
+ */
+static int do_lookup(struct nameidata *nd, struct qstr *name,
+ struct path *path, struct path *cached_path,
+ int flags)
+{
+ struct vfsmount *mnt = nd->mnt;
+ struct dentry *dentry = __d_lookup(nd->dentry, name);
+
+ if (!dentry)
+ goto dcache_miss;
+ if (dentry->d_op && dentry->d_op->d_revalidate)
+ goto need_revalidate;
+done:
+ path->mnt = mnt;
+ path->dentry = dentry;
+ return 0;
+
+dcache_miss:
+ unlock_nd(nd);
+
+need_lookup:
+ dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE);
+ if (IS_ERR(dentry))
+ goto fail;
+ mntget(mnt);
+relock:
+ dput(cached_path->dentry);
+ mntput(cached_path->mnt);
+ cached_path->mnt = mnt;
+ cached_path->dentry = dentry;
+ lock_nd(nd);
+ goto done;
+
+need_revalidate:
+ mntget(mnt);
+ dget_locked(dentry);
+ unlock_nd(nd);
+ if (dentry->d_op->d_revalidate(dentry, flags))
+ goto relock;
+ if (d_invalidate(dentry))
+ goto relock;
+ dput(dentry);
+ mntput(mnt);
+ goto need_lookup;
+
+fail:
+ lock_nd(nd);
+ return PTR_ERR(dentry);
}
/*
@@ -449,15 +555,15 @@
*/
int link_path_walk(const char * name, struct nameidata *nd)
{
- struct dentry *dentry;
+ struct path next, pinned = {NULL, NULL};
struct inode *inode;
int err;
unsigned int lookup_flags = nd->flags;
-
+
while (*name=='/')
name++;
if (!*name)
- goto return_reval;
+ goto return_base;
inode = nd->dentry->d_inode;
if (current->link_count)
@@ -469,8 +575,12 @@
struct qstr this;
unsigned int c;
- err = permission(inode, MAY_EXEC);
- dentry = ERR_PTR(err);
+ err = exec_permission_lite(inode);
+ if (err == -EAGAIN) {
+ unlock_nd(nd);
+ err = permission(inode, MAY_EXEC);
+ lock_nd(nd);
+ }
if (err)
break;
@@ -504,7 +614,7 @@
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
@@ -520,30 +630,30 @@
break;
}
/* This does the actual lookups.. */
- dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
- if (!dentry) {
- dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
- err = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- break;
- }
+ err = do_lookup(nd, &this, &next, &pinned, LOOKUP_CONTINUE);
+ if (err)
+ break;
/* Check mountpoints.. */
- while (d_mountpoint(dentry) && __follow_down(&nd->mnt, &dentry))
- ;
+ follow_mount(&next.mnt, &next.dentry);
err = -ENOENT;
- inode = dentry->d_inode;
+ inode = next.dentry->d_inode;
if (!inode)
- goto out_dput;
+ break;
err = -ENOTDIR;
if (!inode->i_op)
- goto out_dput;
+ break;
if (inode->i_op->follow_link) {
- err = do_follow_link(dentry, nd);
- dput(dentry);
+ mntget(next.mnt);
+ dget_locked(next.dentry);
+ unlock_nd(nd);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
+ lock_nd(nd);
err = -ENOENT;
inode = nd->dentry->d_inode;
if (!inode)
@@ -552,8 +662,8 @@
if (!inode->i_op)
break;
} else {
- dput(nd->dentry);
- nd->dentry = dentry;
+ nd->mnt = next.mnt;
+ nd->dentry = next.dentry;
}
err = -ENOTDIR;
if (!inode->i_op->lookup)
@@ -572,52 +682,47 @@
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
- goto return_reval;
+ goto return_base;
}
if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
err = nd->dentry->d_op->d_hash(nd->dentry, &this);
if (err < 0)
break;
}
- dentry = cached_lookup(nd->dentry, &this, 0);
- if (!dentry) {
- dentry = real_lookup(nd->dentry, &this, 0);
- err = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- break;
- }
- while (d_mountpoint(dentry) && __follow_down(&nd->mnt, &dentry))
- ;
- inode = dentry->d_inode;
+ err = do_lookup(nd, &this, &next, &pinned, 0);
+ if (err)
+ break;
+ follow_mount(&next.mnt, &next.dentry);
+ inode = next.dentry->d_inode;
if ((lookup_flags & LOOKUP_FOLLOW)
&& inode && inode->i_op && inode->i_op->follow_link) {
- err = do_follow_link(dentry, nd);
- dput(dentry);
+ mntget(next.mnt);
+ dget_locked(next.dentry);
+ unlock_nd(nd);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
inode = nd->dentry->d_inode;
+ lock_nd(nd);
} else {
- dput(nd->dentry);
- nd->dentry = dentry;
+ nd->mnt = next.mnt;
+ nd->dentry = next.dentry;
}
err = -ENOENT;
if (!inode)
- goto no_inode;
+ break;
if (lookup_flags & LOOKUP_DIRECTORY) {
err = -ENOTDIR;
if (!inode->i_op || !inode->i_op->lookup)
break;
}
goto return_base;
-no_inode:
- err = -ENOENT;
- if (lookup_flags & (LOOKUP_POSITIVE|LOOKUP_DIRECTORY))
- break;
- goto return_base;
lookup_parent:
nd->last = this;
nd->last_type = LAST_NORM;
@@ -627,33 +732,24 @@
nd->last_type = LAST_DOT;
else if (this.len == 2 && this.name[1] == '.')
nd->last_type = LAST_DOTDOT;
-return_reval:
- /*
- * We bypassed the ordinary revalidation routines.
- * Check the cached dentry for staleness.
- */
- dentry = nd->dentry;
- if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
- err = -ESTALE;
- if (!dentry->d_op->d_revalidate(dentry, 0)) {
- d_invalidate(dentry);
- break;
- }
- }
return_base:
+ unlock_nd(nd);
+ dput(pinned.dentry);
+ mntput(pinned.mnt);
return 0;
-out_dput:
- dput(dentry);
- break;
}
+ unlock_nd(nd);
path_release(nd);
return_err:
+ dput(pinned.dentry);
+ mntput(pinned.mnt);
return err;
}
int path_walk(const char * name, struct nameidata *nd)
{
current->total_link_count = 0;
+ lock_nd(nd);
return link_path_walk(name, nd);
}
@@ -738,28 +834,35 @@
return 1;
}
-/* SMP-safe */
-int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
-{
- int error = 0;
- if (path_init(path, flags, nd))
- error = path_walk(path, nd);
- return error;
-}
-
-/* SMP-safe */
-int path_init(const char *name, unsigned int flags, struct nameidata *nd)
+int path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
{
nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
- if (*name=='/')
- return walk_init_root(name,nd);
- read_lock(¤t->fs->lock);
- nd->mnt = mntget(current->fs->pwdmnt);
- nd->dentry = dget(current->fs->pwd);
- read_unlock(¤t->fs->lock);
- return 1;
+ if (*name=='/') {
+ read_lock(¤t->fs->lock);
+ if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
+ nd->mnt = mntget(current->fs->altrootmnt);
+ nd->dentry = dget(current->fs->altroot);
+ read_unlock(¤t->fs->lock);
+ if (__emul_lookup_dentry(name,nd))
+ return 0;
+ read_lock(¤t->fs->lock);
+ }
+ read_unlock(¤t->fs->lock);
+ spin_lock(&dcache_lock);
+ nd->mnt = current->fs->rootmnt;
+ nd->dentry = current->fs->root;
+ }
+ else{
+ spin_lock(&dcache_lock);
+ nd->mnt = current->fs->pwdmnt;
+ nd->dentry = current->fs->pwd;
+ }
+ nd->old_mnt = NULL;
+ nd->old_dentry = NULL;
+ current->total_link_count = 0;
+ return link_path_walk(name, nd);
}
/*
@@ -1964,6 +2067,7 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
+ lock_nd(nd);
res = link_path_walk(link, nd);
out:
if (current->link_count || res || nd->last_type!=LAST_NORM)
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/namespace.c linux-fastwalk/fs/namespace.c
--- linux-2.4.21-pre1/fs/namespace.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/namespace.c Tue Dec 10 18:19:25 2002
@@ -23,14 +23,13 @@
struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
int do_remount_sb(struct super_block *sb, int flags, void * data);
+extern int __init init_rootfs(void);
void kill_super(struct super_block *sb);
static struct list_head *mount_hashtable;
static int hash_mask, hash_bits;
static kmem_cache_t *mnt_cache;
-extern void init_rootfs(void);
-
static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
{
unsigned long tmp = ((unsigned long) mnt / L1_CACHE_BYTES);
@@ -1023,15 +1022,9 @@
if (!mnt_cache)
panic("Cannot create vfsmount cache");
- mempages >>= (16 - PAGE_SHIFT);
- mempages *= sizeof(struct list_head);
- for (order = 0; ((1UL << order) << PAGE_SHIFT) < mempages; order++)
- ;
-
- do {
- mount_hashtable = (struct list_head *)
- __get_free_pages(GFP_ATOMIC, order);
- } while (mount_hashtable == NULL && --order >= 0);
+ order = 0;
+ mount_hashtable = (struct list_head *)
+ __get_free_pages(GFP_ATOMIC, order);
if (!mount_hashtable)
panic("Failed to allocate mount hash table\n");
diff -Nru -Xdontdiff linux-2.4.21-pre1/fs/nfsd/export.c linux-fastwalk/fs/nfsd/export.c
--- linux-2.4.21-pre1/fs/nfsd/export.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/nfsd/export.c Tue Dec 10 18:19:25 2002
@@ -214,8 +214,7 @@
/* Look up the dentry */
err = 0;
- if (path_init(nxp->ex_path, LOOKUP_POSITIVE, &nd))
- err = path_walk(nxp->ex_path, &nd);
+ err = path_lookup(nxp->ex_path, LOOKUP_POSITIVE, &nd);
if (err)
goto out_unlock;
@@ -411,8 +410,7 @@
err = -EPERM;
if (path) {
- if (path_init(path, LOOKUP_POSITIVE, &nd) &&
- path_walk(path, &nd)) {
+ if (path_lookup(path, LOOKUP_POSITIVE, &nd)) {
printk("nfsd: exp_rootfh path not found %s", path);
return err;
}
diff -Nru -Xdontdiff linux-2.4.21-pre1/include/linux/dcache.h linux-fastwalk/include/linux/dcache.h
--- linux-2.4.21-pre1/include/linux/dcache.h Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/include/linux/dcache.h Tue Dec 10 18:19:25 2002
@@ -219,6 +219,7 @@
/* appendix may either be NULL or be used for transname suffixes */
extern struct dentry * d_lookup(struct dentry *, struct qstr *);
+extern struct dentry * __d_lookup(struct dentry *, struct qstr *);
/* validate "insecure" dentry pointer */
extern int d_validate(struct dentry *, struct dentry *);
diff -Nru -Xdontdiff linux-2.4.21-pre1/include/linux/fs.h linux-fastwalk/include/linux/fs.h
--- linux-2.4.21-pre1/include/linux/fs.h Tue Dec 10 18:14:14 2002
+++ linux-fastwalk/include/linux/fs.h Tue Dec 10 18:19:25 2002
@@ -657,6 +657,8 @@
struct qstr last;
unsigned int flags;
int last_type;
+ struct dentry *old_dentry;
+ struct vfsmount *old_mnt;
};
#define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */
@@ -1325,6 +1327,7 @@
* - require a directory
* - ending slashes ok even for nonexistent files
* - internal "there are more path compnents" flag
+ * - locked when lookup done with dcache_lock held
*/
#define LOOKUP_FOLLOW (1)
#define LOOKUP_DIRECTORY (2)
@@ -1332,6 +1335,7 @@
#define LOOKUP_POSITIVE (8)
#define LOOKUP_PARENT (16)
#define LOOKUP_NOALT (32)
+
/*
* Type of the last component on LOOKUP_PARENT
*/
@@ -1359,7 +1363,6 @@
extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
-extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
extern int FASTCALL(path_walk(const char *, struct nameidata *));
extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
diff -Nru -Xdontdiff linux-2.4.21-pre1/include/linux/fs_struct.h linux-fastwalk/include/linux/fs_struct.h
--- linux-2.4.21-pre1/include/linux/fs_struct.h Fri Jul 13 15:10:44 2001
+++ linux-fastwalk/include/linux/fs_struct.h Tue Dec 10 18:19:25 2002
@@ -32,10 +32,12 @@
struct dentry *old_root;
struct vfsmount *old_rootmnt;
write_lock(&fs->lock);
+ spin_lock(&dcache_lock);
old_root = fs->root;
old_rootmnt = fs->rootmnt;
fs->rootmnt = mntget(mnt);
fs->root = dget(dentry);
+ spin_unlock(&dcache_lock);
write_unlock(&fs->lock);
if (old_root) {
dput(old_root);
@@ -55,10 +57,12 @@
struct dentry *old_pwd;
struct vfsmount *old_pwdmnt;
write_lock(&fs->lock);
+ spin_lock(&dcache_lock);
old_pwd = fs->pwd;
old_pwdmnt = fs->pwdmnt;
fs->pwdmnt = mntget(mnt);
fs->pwd = dget(dentry);
+ spin_unlock(&dcache_lock);
write_unlock(&fs->lock);
if (old_pwd) {
dput(old_pwd);
diff -Nru -Xdontdiff linux-2.4.21-pre1/kernel/ksyms.c linux-fastwalk/kernel/ksyms.c
--- linux-2.4.21-pre1/kernel/ksyms.c Tue Dec 10 18:14:15 2002
+++ linux-fastwalk/kernel/ksyms.c Tue Dec 10 18:19:25 2002
@@ -147,8 +147,8 @@
EXPORT_SYMBOL(follow_up);
EXPORT_SYMBOL(follow_down);
EXPORT_SYMBOL(lookup_mnt);
-EXPORT_SYMBOL(path_init);
EXPORT_SYMBOL(path_walk);
+EXPORT_SYMBOL(path_lookup);
EXPORT_SYMBOL(path_release);
EXPORT_SYMBOL(__user_walk);
EXPORT_SYMBOL(lookup_one_len);
diff -Nru -Xdontdiff linux-2.4.21-pre1/net/unix/af_unix.c linux-fastwalk/net/unix/af_unix.c
--- linux-2.4.21-pre1/net/unix/af_unix.c Thu Nov 28 15:53:16 2002
+++ linux-fastwalk/net/unix/af_unix.c Tue Dec 10 18:19:25 2002
@@ -590,9 +590,8 @@
int err = 0;
if (sunname->sun_path[0]) {
- if (path_init(sunname->sun_path,
- LOOKUP_POSITIVE|LOOKUP_FOLLOW, &nd))
- err = path_walk(sunname->sun_path, &nd);
+ err = path_lookup(sunname->sun_path,
+ LOOKUP_POSITIVE|LOOKUP_FOLLOW, &nd);
if (err)
goto fail;
err = permission(nd.dentry->d_inode,MAY_WRITE);
@@ -685,8 +684,7 @@
* Get the parent directory, calculate the hash for last
* component.
*/
- if (path_init(sunaddr->sun_path, LOOKUP_PARENT, &nd))
- err = path_walk(sunaddr->sun_path, &nd);
+ err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd);
if (err)
goto out_mknod_parent;
/*
^ permalink raw reply
* Linux TOE
From: yiding_wang @ 2002-12-11 2:18 UTC (permalink / raw)
To: linux-kernel
Hello Team,
Does anyone know who or what group is carrying on Linux TOE project? Particularly, I am interested on OS part of driver or layer to support hardware TOE.
Thanks!
Eddie
^ permalink raw reply
* "bio too big" error
From: Wil Reichert @ 2002-12-11 2:17 UTC (permalink / raw)
To: linux-kernel
Hi,
I'm getting a "bio too big" error with 2.5.50. I've got a 330G lvm2
partition formatted with ext3 using the -T largefile4 parameter.
Everything seems ok at first, but any sort of access will die very
unhappily with said error messsage after about 10 seconds of operation
or so. The only google search results are the patch submission. Eeek.
Wil
^ permalink raw reply
* Re: Some general questions about Reiser4
From: Jon Smirl @ 2002-12-11 2:02 UTC (permalink / raw)
To: Hans Reiser; +Cc: reiserfs-list
In-Reply-To: <3DF69476.7070601@namesys.com>
It would be difficult to implement alternative indexes
on the file system if the path is the only key into
the file system. A directory rename in the middle of
the path would ruin a large part of the secondary
index.
I'm with you on SAN vs global. Identifying files by
unique id also has a big advantage in a globally
distributed file system by allowing easy replication.
One project I have been looking in to is to making a
Goolge like interface to the local file system. In
other words provide a set a query terms to the file
system and get back a list of files that match. To do
this efficiently you need to be able to construct
stable, alternative indices.
I've never been a fan of always looking at my file
system via a single view based on path name.
=====
Jon Smirl
jonsmirl@yahoo.com
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
^ permalink raw reply
* problems build usb-serial as a module in 2.5.51
From: Ed Tomlinson @ 2002-12-11 2:09 UTC (permalink / raw)
To: linux-kernel
I get this building 2.5.51
make -f scripts/Makefile.build obj=drivers/usb/serial
gcc -Wp,-MD,drivers/usb/serial/.usb-serial.o.d -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -Iarch/i386/mach-generic -nostdinc -iwithprefix include -DMODULE -DKBUILD_BASENAME=usb_serial -DKBUILD_MODNAME=usbserial -DEXPORT_SYMTAB -c -o drivers/usb/serial/usb-serial.o drivers/usb/serial/usb-serial.c
{standard input}: Assembler messages:
{standard input}:2592: Error: value of -129 too large for field of 1 bytes at 5820
make[3]: *** [drivers/usb/serial/usb-serial.o] Error 1
make[2]: *** [drivers/usb/serial] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2
You have new mail.
TIA
Ed Tomlinson
^ permalink raw reply
* Re: boot sequence
From: dashielljt @ 2002-12-11 2:00 UTC (permalink / raw)
To: dave; +Cc: linux-newbie
In-Reply-To: <200212101157.15232.dave@dpomeroy.com>
ARG! I can't get mysql to do anything useful no matter how I start it up.
Jude <dashielljt(at)gmpexpress-dot-net>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply
* Re: PROBLEM: dvd-drive no longer works (2.4.20)
From: Brendon Higgins @ 2002-12-11 2:04 UTC (permalink / raw)
To: linux-kernel
In-Reply-To: <200212061154.20386.bh_doc@users.sourceforge.net>
Help! I've still got the problem with my DVD drive that I posted a while ago,
and I've recieved no reply for several days. Does anybody have even the
slightest clue what might be going on? I'm stumped, and any input would be
appreciated.
Regardless of any DMA setting, booting still complains with:
...
00) IDE UDMA133 controller on pci00:11.1
ide0: BM-DMA at 0xfc00-0xfc07, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xfc08-0xfc0f, BIOS settings: hdc:DMA, hdd:DMA
hda: ST340016A, ATA DISK drive
hdb: ST310232A, ATA DISK drive
hdc: HITACHI DVD-ROM GD-2500, ATAPI CD/DVD-ROM drive
hdd: CREATIVE CD-RW RW8433E, ATAPI CD/DVD-ROM drive
hdd: set_drive_speed_status: status=0x51 { DriveReady SeekComplete Error }
hdd: set_drive_speed_status: error=0x04
ide1: Drive 1 didn't accept speed setting. Oh, well.
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
...
and
...
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
hdc: status error: status=0x7f { DriveReady DeviceFault SeekComplete
DataRequest CorrectedError Index Error }
hdc: status error: error=0x7f
hdc: DMA disabled
hdc: drive not ready for command
hdc: ATAPI reset complete
hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
hdc: drive not ready for command
hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
hdc: drive not ready for command
hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
hdc: drive not ready for command
ide-scsi: (IO,CoD) != (0,1) while issuing a packet command
hdc: ATAPI reset complete
hdc: status error: status=0x08 { DataRequest }
hdc: drive not ready for command
hdc: ATAPI reset complete
hdc: status error: status=0x08 { DataRequest }
scsi0 channel 0 : resetting for second half of retries.
SCSI bus is being reset for host 0 channel 0.
hdc: drive not ready for command
hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
hdc: drive not ready for command
ide-scsi: (IO,CoD) != (0,1) while issuing a packet command
hdc: ATAPI reset complete
...
Thank you,
Brendon
On Fri, 6 Dec 2002 11:54 am, you wrote:
> On Fri, 6 Dec 2002 2:29 am, you wrote:
> > Could you activate the kernel config option "Enable DMA only for disks"
> > and see if it still happens?
>
> Alas it made no difference. I don't think this is actually about DMA. It
> happens with or without DMA turned on.
>
> Oh, and I forget to mention that I'm not subscribed to the list, so thanx
> for CCing me in your reply.
>
> Peace,
> Brendon
^ permalink raw reply
* Re: Oops on linux 2.4.20-ac1
From: scott thomason @ 2002-12-11 2:00 UTC (permalink / raw)
To: Alan Cox, Orion Poplawski, Linux Kernel Mailing List
In-Reply-To: <1039554145.14175.70.camel@irongate.swansea.linux.org.uk>
On Tuesday 10 December 2002 03:00 pm, Alan Cox wrote:
> Random lockups on dual athlons are a notorious problem under all
> OS's. Start by checking it passes memtest86, that will verify the
> RAM is ok - and the AMD is -very- picky about RAM.
>
> If thats ok then let me know which board you have, what is plugged
> into it and what PSU you are using.
I have two AMD MP 2000+ cpus in an ASUS A7M266-D. Even after returning
my memory for new chips the store owner memtest86'd, my combo of cpus
and mobo was finding the occasional error. I finally ended up
resolving it by simply underclocking the bus about 6Mhz :(
Next time, I'm buying ECC memory.
---scott
^ permalink raw reply
* Re: [PATCH 2.4] Dcache Fastwalk for 2.4.20
From: Hanna Linder @ 2002-12-11 2:07 UTC (permalink / raw)
To: J.A. Magallon; +Cc: Hanna Linder, linux-kernel
In-Reply-To: <20021211010737.GA2879@werewolf.able.es>
--On Wednesday, December 11, 2002 02:07:37 AM +0100 "J.A. Magallon" <jamagallon@able.es> wrote:
> Is you mailer wrapping the patch ?
Hanging head low... I reloaded my mailer and forgot to change
the default line wrapping size... So sorry. Thanks for your
interest though. I will have a 2.4.21-pre1 version soon.
Hanna
------
diff -Nru -Xdontdiff linux-2.4.20/fs/dcache.c linux-fastwalk/fs/dcache.c
--- linux-2.4.20/fs/dcache.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/dcache.c Thu Dec 5 11:46:58 2002
@@ -702,13 +702,25 @@
struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
{
+ struct dentry *dentry = NULL;
+
+ spin_lock(&dcache_lock);
+ dentry = __d_lookup(parent,name);
+ if (dentry)
+ __dget_locked(dentry);
+ spin_unlock(&dcache_lock);
+ return dentry;
+}
+
+struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
+{
+
unsigned int len = name->len;
unsigned int hash = name->hash;
const unsigned char *str = name->name;
struct list_head *head = d_hash(parent,hash);
struct list_head *tmp;
- spin_lock(&dcache_lock);
tmp = head->next;
for (;;) {
struct dentry * dentry = list_entry(tmp, struct dentry, d_hash);
@@ -728,12 +740,9 @@
if (memcmp(dentry->d_name.name, str, len))
continue;
}
- __dget_locked(dentry);
dentry->d_vfs_flags |= DCACHE_REFERENCED;
- spin_unlock(&dcache_lock);
return dentry;
}
- spin_unlock(&dcache_lock);
return NULL;
}
diff -Nru -Xdontdiff linux-2.4.20/fs/intermezzo/journal.c linux-fastwalk/fs/intermezzo/journal.c
--- linux-2.4.20/fs/intermezzo/journal.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/journal.c Thu Dec 5 17:27:47 2002
@@ -617,8 +617,7 @@
CDEBUG(D_CACHE, "looking up: %s\n", path);
- if (path_init(path, LOOKUP_PARENT, nd))
- error = path_walk(path, nd);
+ error = path_lookup(path, LOOKUP_PARENT, nd);
if (error) {
EXIT;
return error;
diff -Nru -Xdontdiff linux-2.4.20/fs/intermezzo/presto.c linux-fastwalk/fs/intermezzo/presto.c
--- linux-2.4.20/fs/intermezzo/presto.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/presto.c Thu Dec 5 17:27:18 2002
@@ -53,8 +53,7 @@
ENTRY;
err = 0;
- if (path_init(name, flags, nd))
- err = path_walk(name, nd);
+ err = path_lookup(name, flags, nd);
return err;
}
diff -Nru -Xdontdiff linux-2.4.20/fs/intermezzo/vfs.c linux-fastwalk/fs/intermezzo/vfs.c
--- linux-2.4.20/fs/intermezzo/vfs.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/intermezzo/vfs.c Mon Dec 9 13:51:43 2002
@@ -702,8 +702,7 @@
/* this looks up the parent */
// if (path_init(pathname, LOOKUP_FOLLOW | LOOKUP_POSITIVE, &nd))
- if (path_init(pathname, LOOKUP_PARENT, &nd))
- error = path_walk(pathname, &nd);
+ error = path_lookup(pathname, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit;
@@ -855,12 +854,10 @@
struct nameidata nd, old_nd;
error = 0;
- if (path_init(from, LOOKUP_POSITIVE, &old_nd))
- error = path_walk(from, &old_nd);
+ error = path_lookup(from, LOOKUP_POSITIVE, &old_nd);
if (error)
goto exit;
- if (path_init(to, LOOKUP_PARENT, &nd))
- error = path_walk(to, &nd);
+ error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error)
goto out;
error = -EXDEV;
@@ -1062,8 +1059,7 @@
if(IS_ERR(name))
return PTR_ERR(name);
- if (path_init(name, LOOKUP_PARENT, &nd))
- error = path_walk(name, &nd);
+ error = path_lookup(name, LOOKUP_PARENT, &nd);
if (error)
goto exit;
error = -EISDIR;
@@ -1223,8 +1219,7 @@
goto exit_from;
}
- if (path_init(to, LOOKUP_PARENT, &nd))
- error = path_walk(to, &nd);
+ error = path_lookup(to, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit_to;
@@ -1381,8 +1376,7 @@
return error;
}
- if (path_init(pathname, LOOKUP_PARENT, &nd))
- error = path_walk(pathname, &nd);
+ error = path_lookup(pathname, LOOKUP_PARENT, &nd);
if (error)
goto out_name;
@@ -1527,8 +1521,7 @@
return PTR_ERR(name);
}
- if (path_init(name, LOOKUP_PARENT, &nd))
- error = path_walk(name, &nd);
+ error = path_lookup(name, LOOKUP_PARENT, &nd);
if (error) {
EXIT;
goto exit;
@@ -1693,8 +1686,7 @@
if (IS_ERR(tmp))
return PTR_ERR(tmp);
- if (path_init(tmp, LOOKUP_PARENT, &nd))
- error = path_walk(tmp, &nd);
+ error = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (error)
goto out;
dentry = lookup_create(&nd, 0);
@@ -1973,14 +1965,11 @@
ENTRY;
- if (path_init(oldname, LOOKUP_PARENT, &oldnd))
- error = path_walk(oldname, &oldnd);
-
+ error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
if (error)
goto exit;
- if (path_init(newname, LOOKUP_PARENT, &newnd))
- error = path_walk(newname, &newnd);
+ error = path_lookup(newname, LOOKUP_PARENT, &newnd);
if (error)
goto exit1;
diff -Nru -Xdontdiff linux-2.4.20/fs/namei.c linux-fastwalk/fs/namei.c
--- linux-2.4.20/fs/namei.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/namei.c Thu Dec 5 16:55:04 2002
@@ -263,7 +263,7 @@
static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags)
{
struct dentry * dentry = d_lookup(parent, name);
-
+
if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
dput(dentry);
@@ -273,6 +273,61 @@
return dentry;
}
+/*for fastwalking*/
+static inline void unlock_nd(struct nameidata *nd)
+{
+ struct vfsmount *mnt = nd->old_mnt;
+ struct dentry *dentry = nd->old_dentry;
+ mntget(nd->mnt);
+ dget_locked(nd->dentry);
+ nd->old_mnt = NULL;
+ nd->old_dentry = NULL;
+ spin_unlock(&dcache_lock);
+ dput(dentry);
+ mntput(mnt);
+}
+
+static inline void lock_nd(struct nameidata *nd)
+{
+ spin_lock(&dcache_lock);
+ nd->old_mnt = nd->mnt;
+ nd->old_dentry = nd->dentry;
+}
+
+/*
+ * Short-cut version of permission(), for calling by
+ * path_walk(), when dcache lock is held. Combines parts
+ * of permission() and vfs_permission(), and tests ONLY for
+ * MAY_EXEC permission.
+ *
+ * If appropriate, check DAC only. If not appropriate, or
+ * short-cut DAC fails, then call permission() to do more
+ * complete permission check.
+ */
+static inline int exec_permission_lite(struct inode *inode)
+{
+ umode_t mode = inode->i_mode;
+
+ if ((inode->i_op && inode->i_op->permission))
+ return -EAGAIN;
+
+ if (current->fsuid == inode->i_uid)
+ mode >>= 6;
+ else if (in_group_p(inode->i_gid))
+ mode >>= 3;
+
+ if (mode & MAY_EXEC)
+ return 0;
+
+ if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
+ return 0;
+
+ if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
+ return 0;
+
+ return -EACCES;
+}
+
/*
* This is called when everything else fails, and we actually have
* to go to the low-level filesystem to find out what we should do..
@@ -354,10 +409,10 @@
return -ELOOP;
}
-static inline int __follow_up(struct vfsmount **mnt, struct dentry **base)
+int follow_up(struct vfsmount **mnt, struct dentry **dentry)
{
struct vfsmount *parent;
- struct dentry *dentry;
+ struct dentry *mountpoint;
spin_lock(&dcache_lock);
parent=(*mnt)->mnt_parent;
if (parent == *mnt) {
@@ -365,18 +420,27 @@
return 0;
}
mntget(parent);
- dentry=dget((*mnt)->mnt_mountpoint);
+ mountpoint=dget((*mnt)->mnt_mountpoint);
spin_unlock(&dcache_lock);
- dput(*base);
- *base = dentry;
+ dput(*dentry);
+ *dentry = mountpoint;
mntput(*mnt);
*mnt = parent;
return 1;
}
-int follow_up(struct vfsmount **mnt, struct dentry **dentry)
+static int follow_mount(struct vfsmount **mnt, struct dentry **dentry)
{
- return __follow_up(mnt, dentry);
+ int res = 0;
+ while (d_mountpoint(*dentry)) {
+ struct vfsmount *mounted = lookup_mnt(*mnt, *dentry);
+ if (!mounted)
+ break;
+ *mnt = mounted;
+ *dentry = mounted->mnt_root;
+ res = 1;
+ }
+ return res;
}
static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry)
@@ -402,41 +466,83 @@
return __follow_down(mnt,dentry);
}
-static inline void follow_dotdot(struct nameidata *nd)
+static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
{
while(1) {
struct vfsmount *parent;
- struct dentry *dentry;
- read_lock(¤t->fs->lock);
- if (nd->dentry == current->fs->root &&
- nd->mnt == current->fs->rootmnt) {
- read_unlock(¤t->fs->lock);
+ if (*dentry == current->fs->root &&
+ *mnt == current->fs->rootmnt)
break;
- }
- read_unlock(¤t->fs->lock);
- spin_lock(&dcache_lock);
- if (nd->dentry != nd->mnt->mnt_root) {
- dentry = dget(nd->dentry->d_parent);
- spin_unlock(&dcache_lock);
- dput(nd->dentry);
- nd->dentry = dentry;
+ if (*dentry != (*mnt)->mnt_root) {
+ *dentry = (*dentry)->d_parent;
break;
}
- parent=nd->mnt->mnt_parent;
- if (parent == nd->mnt) {
- spin_unlock(&dcache_lock);
+ parent=(*mnt)->mnt_parent;
+ if (parent == *mnt)
break;
- }
- mntget(parent);
- dentry=dget(nd->mnt->mnt_mountpoint);
- spin_unlock(&dcache_lock);
- dput(nd->dentry);
- nd->dentry = dentry;
- mntput(nd->mnt);
- nd->mnt = parent;
+ *dentry=(*mnt)->mnt_mountpoint;
+ *mnt = parent;
}
- while (d_mountpoint(nd->dentry) && __follow_down(&nd->mnt, &nd->dentry))
- ;
+ follow_mount(mnt, dentry);
+}
+
+struct path {
+ struct vfsmount *mnt;
+ struct dentry *dentry;
+};
+
+/*
+ * It's more convoluted than I'd like it to be, but... it's still fairly
+ * small and for now I'd prefer to have fast path as straight as possible.
+ * It _is_ time-critical.
+ */
+static int do_lookup(struct nameidata *nd, struct qstr *name,
+ struct path *path, struct path *cached_path,
+ int flags)
+{
+ struct vfsmount *mnt = nd->mnt;
+ struct dentry *dentry = __d_lookup(nd->dentry, name);
+
+ if (!dentry)
+ goto dcache_miss;
+ if (dentry->d_op && dentry->d_op->d_revalidate)
+ goto need_revalidate;
+done:
+ path->mnt = mnt;
+ path->dentry = dentry;
+ return 0;
+
+dcache_miss:
+ unlock_nd(nd);
+
+need_lookup:
+ dentry = real_lookup(nd->dentry, name, LOOKUP_CONTINUE);
+ if (IS_ERR(dentry))
+ goto fail;
+ mntget(mnt);
+relock:
+ dput(cached_path->dentry);
+ mntput(cached_path->mnt);
+ cached_path->mnt = mnt;
+ cached_path->dentry = dentry;
+ lock_nd(nd);
+ goto done;
+
+need_revalidate:
+ mntget(mnt);
+ dget_locked(dentry);
+ unlock_nd(nd);
+ if (dentry->d_op->d_revalidate(dentry, flags))
+ goto relock;
+ if (d_invalidate(dentry))
+ goto relock;
+ dput(dentry);
+ mntput(mnt);
+ goto need_lookup;
+
+fail:
+ lock_nd(nd);
+ return PTR_ERR(dentry);
}
/*
@@ -449,15 +555,15 @@
*/
int link_path_walk(const char * name, struct nameidata *nd)
{
- struct dentry *dentry;
+ struct path next, pinned = {NULL, NULL};
struct inode *inode;
int err;
unsigned int lookup_flags = nd->flags;
-
+
while (*name=='/')
name++;
if (!*name)
- goto return_reval;
+ goto return_base;
inode = nd->dentry->d_inode;
if (current->link_count)
@@ -469,8 +575,12 @@
struct qstr this;
unsigned int c;
- err = permission(inode, MAY_EXEC);
- dentry = ERR_PTR(err);
+ err = exec_permission_lite(inode);
+ if (err == -EAGAIN) {
+ unlock_nd(nd);
+ err = permission(inode, MAY_EXEC);
+ lock_nd(nd);
+ }
if (err)
break;
@@ -504,7 +614,7 @@
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
@@ -520,30 +630,30 @@
break;
}
/* This does the actual lookups.. */
- dentry = cached_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
- if (!dentry) {
- dentry = real_lookup(nd->dentry, &this, LOOKUP_CONTINUE);
- err = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- break;
- }
+ err = do_lookup(nd, &this, &next, &pinned, LOOKUP_CONTINUE);
+ if (err)
+ break;
/* Check mountpoints.. */
- while (d_mountpoint(dentry) && __follow_down(&nd->mnt, &dentry))
- ;
+ follow_mount(&next.mnt, &next.dentry);
err = -ENOENT;
- inode = dentry->d_inode;
+ inode = next.dentry->d_inode;
if (!inode)
- goto out_dput;
+ break;
err = -ENOTDIR;
if (!inode->i_op)
- goto out_dput;
+ break;
if (inode->i_op->follow_link) {
- err = do_follow_link(dentry, nd);
- dput(dentry);
+ mntget(next.mnt);
+ dget_locked(next.dentry);
+ unlock_nd(nd);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
+ lock_nd(nd);
err = -ENOENT;
inode = nd->dentry->d_inode;
if (!inode)
@@ -552,8 +662,8 @@
if (!inode->i_op)
break;
} else {
- dput(nd->dentry);
- nd->dentry = dentry;
+ nd->mnt = next.mnt;
+ nd->dentry = next.dentry;
}
err = -ENOTDIR;
if (!inode->i_op->lookup)
@@ -572,52 +682,47 @@
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
- goto return_reval;
+ goto return_base;
}
if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
err = nd->dentry->d_op->d_hash(nd->dentry, &this);
if (err < 0)
break;
}
- dentry = cached_lookup(nd->dentry, &this, 0);
- if (!dentry) {
- dentry = real_lookup(nd->dentry, &this, 0);
- err = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- break;
- }
- while (d_mountpoint(dentry) && __follow_down(&nd->mnt, &dentry))
- ;
- inode = dentry->d_inode;
+ err = do_lookup(nd, &this, &next, &pinned, 0);
+ if (err)
+ break;
+ follow_mount(&next.mnt, &next.dentry);
+ inode = next.dentry->d_inode;
if ((lookup_flags & LOOKUP_FOLLOW)
&& inode && inode->i_op && inode->i_op->follow_link) {
- err = do_follow_link(dentry, nd);
- dput(dentry);
+ mntget(next.mnt);
+ dget_locked(next.dentry);
+ unlock_nd(nd);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
inode = nd->dentry->d_inode;
+ lock_nd(nd);
} else {
- dput(nd->dentry);
- nd->dentry = dentry;
+ nd->mnt = next.mnt;
+ nd->dentry = next.dentry;
}
err = -ENOENT;
if (!inode)
- goto no_inode;
+ break;
if (lookup_flags & LOOKUP_DIRECTORY) {
err = -ENOTDIR;
if (!inode->i_op || !inode->i_op->lookup)
break;
}
goto return_base;
-no_inode:
- err = -ENOENT;
- if (lookup_flags & (LOOKUP_POSITIVE|LOOKUP_DIRECTORY))
- break;
- goto return_base;
lookup_parent:
nd->last = this;
nd->last_type = LAST_NORM;
@@ -627,33 +732,24 @@
nd->last_type = LAST_DOT;
else if (this.len == 2 && this.name[1] == '.')
nd->last_type = LAST_DOTDOT;
-return_reval:
- /*
- * We bypassed the ordinary revalidation routines.
- * Check the cached dentry for staleness.
- */
- dentry = nd->dentry;
- if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
- err = -ESTALE;
- if (!dentry->d_op->d_revalidate(dentry, 0)) {
- d_invalidate(dentry);
- break;
- }
- }
return_base:
+ unlock_nd(nd);
+ dput(pinned.dentry);
+ mntput(pinned.mnt);
return 0;
-out_dput:
- dput(dentry);
- break;
}
+ unlock_nd(nd);
path_release(nd);
return_err:
+ dput(pinned.dentry);
+ mntput(pinned.mnt);
return err;
}
int path_walk(const char * name, struct nameidata *nd)
{
current->total_link_count = 0;
+ lock_nd(nd);
return link_path_walk(name, nd);
}
@@ -738,28 +834,35 @@
return 1;
}
-/* SMP-safe */
-int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
-{
- int error = 0;
- if (path_init(path, flags, nd))
- error = path_walk(path, nd);
- return error;
-}
-
-/* SMP-safe */
-int path_init(const char *name, unsigned int flags, struct nameidata *nd)
+int path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
{
nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
- if (*name=='/')
- return walk_init_root(name,nd);
- read_lock(¤t->fs->lock);
- nd->mnt = mntget(current->fs->pwdmnt);
- nd->dentry = dget(current->fs->pwd);
- read_unlock(¤t->fs->lock);
- return 1;
+ if (*name=='/') {
+ read_lock(¤t->fs->lock);
+ if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
+ nd->mnt = mntget(current->fs->altrootmnt);
+ nd->dentry = dget(current->fs->altroot);
+ read_unlock(¤t->fs->lock);
+ if (__emul_lookup_dentry(name,nd))
+ return 0;
+ read_lock(¤t->fs->lock);
+ }
+ read_unlock(¤t->fs->lock);
+ spin_lock(&dcache_lock);
+ nd->mnt = current->fs->rootmnt;
+ nd->dentry = current->fs->root;
+ }
+ else{
+ spin_lock(&dcache_lock);
+ nd->mnt = current->fs->pwdmnt;
+ nd->dentry = current->fs->pwd;
+ }
+ nd->old_mnt = NULL;
+ nd->old_dentry = NULL;
+ current->total_link_count = 0;
+ return link_path_walk(name, nd);
}
/*
@@ -1964,6 +2067,7 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
+ lock_nd(nd);
res = link_path_walk(link, nd);
out:
if (current->link_count || res || nd->last_type!=LAST_NORM)
diff -Nru -Xdontdiff linux-2.4.20/fs/namespace.c linux-fastwalk/fs/namespace.c
--- linux-2.4.20/fs/namespace.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/namespace.c Mon Dec 9 15:10:23 2002
@@ -23,14 +23,13 @@
struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
int do_remount_sb(struct super_block *sb, int flags, void * data);
+extern int __init init_rootfs(void);
void kill_super(struct super_block *sb);
static struct list_head *mount_hashtable;
static int hash_mask, hash_bits;
static kmem_cache_t *mnt_cache;
-extern void init_rootfs(void);
-
static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
{
unsigned long tmp = ((unsigned long) mnt / L1_CACHE_BYTES);
@@ -1023,15 +1022,9 @@
if (!mnt_cache)
panic("Cannot create vfsmount cache");
- mempages >>= (16 - PAGE_SHIFT);
- mempages *= sizeof(struct list_head);
- for (order = 0; ((1UL << order) << PAGE_SHIFT) < mempages; order++)
- ;
-
- do {
- mount_hashtable = (struct list_head *)
- __get_free_pages(GFP_ATOMIC, order);
- } while (mount_hashtable == NULL && --order >= 0);
+ order = 0;
+ mount_hashtable = (struct list_head *)
+ __get_free_pages(GFP_ATOMIC, order);
if (!mount_hashtable)
panic("Failed to allocate mount hash table\n");
diff -Nru -Xdontdiff linux-2.4.20/fs/nfsd/export.c linux-fastwalk/fs/nfsd/export.c
--- linux-2.4.20/fs/nfsd/export.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/fs/nfsd/export.c Thu Dec 5 17:22:12 2002
@@ -214,8 +214,7 @@
/* Look up the dentry */
err = 0;
- if (path_init(nxp->ex_path, LOOKUP_POSITIVE, &nd))
- err = path_walk(nxp->ex_path, &nd);
+ err = path_lookup(nxp->ex_path, LOOKUP_POSITIVE, &nd);
if (err)
goto out_unlock;
@@ -411,8 +410,7 @@
err = -EPERM;
if (path) {
- if (path_init(path, LOOKUP_POSITIVE, &nd) &&
- path_walk(path, &nd)) {
+ if (path_lookup(path, LOOKUP_POSITIVE, &nd)) {
printk("nfsd: exp_rootfh path not found %s", path);
return err;
}
diff -Nru -Xdontdiff linux-2.4.20/include/linux/dcache.h linux-fastwalk/include/linux/dcache.h
--- linux-2.4.20/include/linux/dcache.h Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/include/linux/dcache.h Thu Dec 5 11:50:17 2002
@@ -219,6 +219,7 @@
/* appendix may either be NULL or be used for transname suffixes */
extern struct dentry * d_lookup(struct dentry *, struct qstr *);
+extern struct dentry * __d_lookup(struct dentry *, struct qstr *);
/* validate "insecure" dentry pointer */
extern int d_validate(struct dentry *, struct dentry *);
diff -Nru -Xdontdiff linux-2.4.20/include/linux/fs.h linux-fastwalk/include/linux/fs.h
--- linux-2.4.20/include/linux/fs.h Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/include/linux/fs.h Thu Dec 5 17:49:13 2002
@@ -657,6 +657,8 @@
struct qstr last;
unsigned int flags;
int last_type;
+ struct dentry *old_dentry;
+ struct vfsmount *old_mnt;
};
#define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */
@@ -1296,6 +1298,7 @@
* - require a directory
* - ending slashes ok even for nonexistent files
* - internal "there are more path compnents" flag
+ * - locked when lookup done with dcache_lock held
*/
#define LOOKUP_FOLLOW (1)
#define LOOKUP_DIRECTORY (2)
@@ -1303,6 +1306,7 @@
#define LOOKUP_POSITIVE (8)
#define LOOKUP_PARENT (16)
#define LOOKUP_NOALT (32)
+
/*
* Type of the last component on LOOKUP_PARENT
*/
@@ -1330,7 +1334,6 @@
extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
-extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
extern int FASTCALL(path_walk(const char *, struct nameidata *));
extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
diff -Nru -Xdontdiff linux-2.4.20/include/linux/fs_struct.h linux-fastwalk/include/linux/fs_struct.h
--- linux-2.4.20/include/linux/fs_struct.h Fri Jul 13 15:10:44 2001
+++ linux-fastwalk/include/linux/fs_struct.h Thu Dec 5 11:50:17 2002
@@ -32,10 +32,12 @@
struct dentry *old_root;
struct vfsmount *old_rootmnt;
write_lock(&fs->lock);
+ spin_lock(&dcache_lock);
old_root = fs->root;
old_rootmnt = fs->rootmnt;
fs->rootmnt = mntget(mnt);
fs->root = dget(dentry);
+ spin_unlock(&dcache_lock);
write_unlock(&fs->lock);
if (old_root) {
dput(old_root);
@@ -55,10 +57,12 @@
struct dentry *old_pwd;
struct vfsmount *old_pwdmnt;
write_lock(&fs->lock);
+ spin_lock(&dcache_lock);
old_pwd = fs->pwd;
old_pwdmnt = fs->pwdmnt;
fs->pwdmnt = mntget(mnt);
fs->pwd = dget(dentry);
+ spin_unlock(&dcache_lock);
write_unlock(&fs->lock);
if (old_pwd) {
dput(old_pwd);
diff -Nru -Xdontdiff linux-2.4.20/kernel/ksyms.c linux-fastwalk/kernel/ksyms.c
--- linux-2.4.20/kernel/ksyms.c Thu Nov 28 15:53:15 2002
+++ linux-fastwalk/kernel/ksyms.c Thu Dec 5 17:49:41 2002
@@ -146,8 +146,8 @@
EXPORT_SYMBOL(follow_up);
EXPORT_SYMBOL(follow_down);
EXPORT_SYMBOL(lookup_mnt);
-EXPORT_SYMBOL(path_init);
EXPORT_SYMBOL(path_walk);
+EXPORT_SYMBOL(path_lookup);
EXPORT_SYMBOL(path_release);
EXPORT_SYMBOL(__user_walk);
EXPORT_SYMBOL(lookup_one_len);
diff -Nru -Xdontdiff linux-2.4.20/net/unix/af_unix.c linux-fastwalk/net/unix/af_unix.c
--- linux-2.4.20/net/unix/af_unix.c Thu Nov 28 15:53:16 2002
+++ linux-fastwalk/net/unix/af_unix.c Thu Dec 5 17:29:36 2002
@@ -590,9 +590,8 @@
int err = 0;
if (sunname->sun_path[0]) {
- if (path_init(sunname->sun_path,
- LOOKUP_POSITIVE|LOOKUP_FOLLOW, &nd))
- err = path_walk(sunname->sun_path, &nd);
+ err = path_lookup(sunname->sun_path,
+ LOOKUP_POSITIVE|LOOKUP_FOLLOW, &nd);
if (err)
goto fail;
err = permission(nd.dentry->d_inode,MAY_WRITE);
@@ -685,8 +684,7 @@
* Get the parent directory, calculate the hash for last
* component.
*/
- if (path_init(sunaddr->sun_path, LOOKUP_PARENT, &nd))
- err = path_walk(sunaddr->sun_path, &nd);
+ err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd);
if (err)
goto out_mknod_parent;
/*
^ permalink raw reply
* Re: [BK prob] - bogus cset
From: Larry McVoy @ 2002-12-11 1:49 UTC (permalink / raw)
To: Larry McVoy, linux-kernel
In-Reply-To: <20021210174253.A29772@work.bitmover.com>
Anders Gustafsson just reminded me of "bk unpull". If you do a
bk unpull
bk pull
You'll be all set. Much easier. Thanks, Anders!
--lm
On Tue, Dec 10, 2002 at 05:42:53PM -0800, Larry McVoy wrote:
> By the way, the set of people who need to clean up are:
>
> agoddard
> aliz
> andersg
> anton
> chrisl
> cloos
> frival
> fsirl
> peterc
> purna
> riel
> rp
> steve
> vonbrand
>
> according to the logs.
>
> On Tue, Dec 10, 2002 at 05:40:01PM -0800, Larry McVoy wrote:
> > I'm an idiot, in the process of optimizing the logging code (so you modem
> > users send less data, a big deal in Europe), I put a test cset into the
> > main tree at bk://linux.bkbits.net/linux-2.5 and a pile of people pulled
> > it.
> >
> > Could you please do this:
> >
> > bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet
> >
> > If that returns nothing, you're fine. If it tells you a revision, then
> > if that is the most recent revision, just do a
> >
> > bk undo -fr`bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet`
> >
> > and you're all set. If that isn't the most recent revision, i.e., you merged
> > against that, send me an email and I'll straighten out the tree.
> >
> > Sorry about this, it won't happen again.
> >
> > --lm
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
>
> --
> ---
> Larry McVoy lm at bitmover.com http://www.bitmover.com/lm
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
---
Larry McVoy lm at bitmover.com http://www.bitmover.com/lm
^ permalink raw reply
* Re: ax25 kernel problem sometimes accur
From: Ralf Baechle DO1GRB @ 2002-12-11 1:40 UTC (permalink / raw)
To: Tomi Manninen OH2BNS; +Cc: linux-hams
In-Reply-To: <Pine.HPX.4.10.10212101608040.23101-100000@saturn.trs.ntc.nokia.com>
On Tue, Dec 10, 2002 at 04:09:20PM +0200, Tomi Manninen OH2BNS wrote:
> > I consider everything I'm currently working on as pure bug fix. As such
> > they're not affected by the feature freeze.
>
> Agreed.
>
> Anyway, what is the situation now? Are there still lots of known races
> unfixed in your tree?
The whole job is much bigger than you may assume. I've removed
SOCKOPS_WRAP which so far was forcing single threaded execution of most of
the AX.25 code. I did that because for 2.5 the removal of SOCKOPS_WRAP
the entire kernel was on the agenda. This didn't happen yet but I'm
removed it's use from AX.25 & Co. anyway. As the result the entire locking
work isn't just plugging a few holes which would have been bad enough, it's
completly redoing the locking stuff from scratch.
73 de DO1GRB op Ralf
--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21
^ permalink raw reply
* Re: [BK prob] - bogus cset
From: Larry McVoy @ 2002-12-11 1:42 UTC (permalink / raw)
To: Larry McVoy; +Cc: linux-kernel
In-Reply-To: <200212110140.gBB1e1o30094@work.bitmover.com>
By the way, the set of people who need to clean up are:
agoddard
aliz
andersg
anton
chrisl
cloos
frival
fsirl
peterc
purna
riel
rp
steve
vonbrand
according to the logs.
On Tue, Dec 10, 2002 at 05:40:01PM -0800, Larry McVoy wrote:
> I'm an idiot, in the process of optimizing the logging code (so you modem
> users send less data, a big deal in Europe), I put a test cset into the
> main tree at bk://linux.bkbits.net/linux-2.5 and a pile of people pulled
> it.
>
> Could you please do this:
>
> bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet
>
> If that returns nothing, you're fine. If it tells you a revision, then
> if that is the most recent revision, just do a
>
> bk undo -fr`bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet`
>
> and you're all set. If that isn't the most recent revision, i.e., you merged
> against that, send me an email and I'll straighten out the tree.
>
> Sorry about this, it won't happen again.
>
> --lm
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
---
Larry McVoy lm at bitmover.com http://www.bitmover.com/lm
^ permalink raw reply
* Re: IDE feature request & problem
From: Barry K. Nathan @ 2002-12-11 1:42 UTC (permalink / raw)
To: Milan Roubal; +Cc: Petr Sebor, Alan Cox, linux-kernel
In-Reply-To: <021401c2a05d$f1c72c80$551b71c3@krlis>
On Tue, Dec 10, 2002 at 04:07:54PM +0100, Milan Roubal wrote:
> Nov 28 17:54:04 fileserver kernel: ide6: reset: master: error (0x7f?)
^^^^
> Nov 28 17:54:14 fileserver kernel: hdn: lost interrupt
> Nov 28 17:54:14 fileserver kernel: hdn: set_multmode: status=0x7f {
^^^^
> DriveReady DeviceFault SeekComplete DataRequest CorrectedError Index Error }
> Nov 28 17:54:14 fileserver kernel: hdn: set_multmode: error=0x7f {
^^^^
> DriveStatusError UncorrectableError SectorIdNotFound TrackZeroNotFound
> AddrMarkNotFound }, LBAsect=8830595334015, high=526344, low=8355711,
> sector=196817664
> Nov 28 17:54:24 fileserver kernel: hdn: lost interrupt
> Nov 28 17:54:24 fileserver kernel: hdn: recal_intr: status=0x7f { DriveReady
^^^^
> DeviceFault SeekComplete DataRequest CorrectedError Index Error }
> Nov 28 17:54:24 fileserver kernel: hdn: recal_intr: error=0x7f {
^^^^
> DriveStatusError UncorrectableError SectorIdNotFound TrackZeroNotFound
> AddrMarkNotFound }, LBAsect=8830595334015, high=526344, low=8355711,
> sector=196817664
> Nov 28 17:54:24 fileserver kernel: PDC202XX: Primary channel reset.
> Nov 28 17:54:24 fileserver kernel: ide6: reset: master: error (0x7f?)
^^^^
Hmmm... 0x7f... Christmas lights? ;)
Just pointing this out in case nobody else noticed and in case it might
help troubleshoot the problem.
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply
* [BK prob] - bogus cset
From: Larry McVoy @ 2002-12-11 1:40 UTC (permalink / raw)
To: linux-kernel
I'm an idiot, in the process of optimizing the logging code (so you modem
users send less data, a big deal in Europe), I put a test cset into the
main tree at bk://linux.bkbits.net/linux-2.5 and a pile of people pulled
it.
Could you please do this:
bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet
If that returns nothing, you're fine. If it tells you a revision, then
if that is the most recent revision, just do a
bk undo -fr`bk findkey 'lm@work.bitmover.com|ChangeSet|20021211000341|36093' ChangeSet`
and you're all set. If that isn't the most recent revision, i.e., you merged
against that, send me an email and I'll straighten out the tree.
Sorry about this, it won't happen again.
--lm
^ permalink raw reply
* Re: Anti-virus for Sendmail
From: dashielljt @ 2002-12-11 1:30 UTC (permalink / raw)
To: Scott Taylor; +Cc: linux-admin
In-Reply-To: <5.1.1.6.0.20021210091046.01bee1b8@mustang>
Does anyone know of an antivirus package for linux that doesn't need any
gui interface to run? I'm using text only here since my screen reader
likes it that way. If the screen reader doesn't work on this system
either speakup or emacspeak the computer isn't providing me any useful
output.
Jude <dashielljt(at)gmpexpress-dot-net>
^ permalink raw reply
* Re: Some general questions about Reiser4
From: Hans Reiser @ 2002-12-11 1:27 UTC (permalink / raw)
To: Jon Smirl; +Cc: reiserfs-list
In-Reply-To: <20021211011332.44177.qmail@web14914.mail.yahoo.com>
Jon Smirl wrote:
>After reading though all of the material on the web
>site and looking at the source code for a while, I do
>have to congratulate you on having one of the best
>documented programming projects I have seen. Here are
>still a few areas that I have questions about....
>
>1) The doc talks about doing something like "ls
>file/attrib" to see an attribute that is implemented
>as a tiny file. Does this work on Reiser4? How do I
>access it? I tried this on my Reiser4 system and
>couldn't figure it out.
>
Not yet implemented, but the infrastructure is getting there. We
(somewhat) adhere to the define the minimum functionality needed to
ship, make it work, ship, then do the rest development model.
>
>2) Looking at Reiser 4 as a database, would the path
>to the file be considered a primary key?
>
The name within the directory would be considered the primary key in the
semantic layer.
> Or is the
>primary key to the file system an unique ID and the
>path looks up the unique ID? Could I create an
>alternative index into the file system based on say
>creation date or permissions?
>
The "key" is considered the primary/only key in the storage layer.
>
>3) Has special consideration been made for parallelism
>on SMP systems? For example, common hot spots on
>databases are disk allocation, logging, and unique id
>generation. These can be implemented so that each
>processor gets it own independent copy and never has
>to lock against the other CPUs.
>
How do I put it. Reiser4 scales perfectly in its design;-), and there
will be a long period of running benchmarks and finding bottlenecks we
failed to consider.
>
>4) Since Reiser4 is already SMP capable, how far is it
>from being clusterable over a SAN?
>
About $850,000 far away.;-) I say this without having done a real study
of it. We have sold licenses to reiser3 to proprietary clustering fs
vendors. They spend orders of magnitude more than that, but I am far
lower in my costs than they are (no silicon valley office, etc.)
>Having GFS go
>closed source has left an opening for a new
>alternative.
>
Encourage your local government to give us a grant, and we'll do it.;-)
I am a bit more interested in globally distributed than SAN, but I am
flexible. Everybody is doing clusters, so I would prefer to go globally
distributed and make them the smaller niche market. NFS doesn't scale
globally, etc., etc.
>
>
>=====
>Jon Smirl
>jonsmirl@yahoo.com
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>
>
>
>
Best,
Hans
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.