nfsd-fh: found a name that I didn't expect
Subsystems (5)
Hi,
due to hardware problems I just started our fall back server and got these messages for 2 files:
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd: last server has exited
nfsd: unexporting all filesystems
nfsd-fh: found a name that I didn't expect: lib/libident.so.0
nfsd-fh: found a name that I didn't expect: lib/libident.so.0
Well, just a small explanation how our fall back-solution works:
The server exports '/' (hda5) via nfs to all clients and via nbd to one of
its clients (the fall back server) . The exporting via nbd is used for mirroring the device via a cron job (by "dd'ing" the device).
The cron-job script also executes a 'reiserfsck --fix-fixable' and afterwards a 'reiserfsck --check', so except doing the partionchecks, both devices should be identical.
However, when I started the fall-back server, it showed the messages for these 2 files and the clients got I/O errors for these files.
The solution was to stop the nfs-server, copy the files, delete the old ones and move the copies back to the old names (just as I'm used to be to do when this happens to directories served by ClusterNFS).
Any ideas how we can prevent this in the future ?
Thanks,
Bernd
Hello!
Quoted 8 lines · Bernd Schubert
due to hardware problems I just started our fall back server and got these messages for 2 files:
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd: last server has exited
nfsd: unexporting all filesystems
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
Hm. Does the message is visible each time you access those files? Does reiserfsck have found anything?
Quoted 1 line
Any ideas how we can prevent this in the future ?
We do not yet understand on how to reproduce that locally, because this message indicates pretty strange conditions.
Bye,
Oleg
Quoted 12 lines · you
Hello!
Quoted 8 lines · Bernd Schubert
due to hardware problems I just started our fall back server and got these messages for 2 files:
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd: last server has exited
nfsd: unexporting all filesystems
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
Quoted 1 line
Hm. Does the message is visible each time you access those files?
Yes, probably since uptime and libident.so.0 were called in and endless loop from the clients, the nfs-servers log was filled with those messages and I had to stop the nfsd and do the cp- and mv-procedure for those files.
Quoted 1 line
Does reiserfsck have found anything?
As I said, the backup script runs a reiserfsck itself and found no problems, I hope there is no corruption after a simple boot, but I will check this later on this day.
Quoted 5 lines
Quoted 2 lines
Any ideas how we can prevent this in the future ?
We do not yet understand on how to reproduce that locally, because this message indicates pretty strange conditions.
Is there anything I can do to debug this, when I observe this phenomena the next time (e.g. enabling nfs-debugging via proc, etc) ?
Thanks,
Bernd
Hello!
Quoted 8 lines · Bernd Schubert
Quoted 8 lines
Quoted 8 lines
due to hardware problems I just started our fall back server and got these messages for 2 files:
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd-fh: found a name that I didn't expect: bin/uptime
nfsd: last server has exited
nfsd: unexporting all filesystems
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
nfsd-fh: found a name that I didn't expect:lib/libident.so.0
Quoted 4 lines
Quoted 1 line
Hm. Does the message is visible each time you access those files?
Yes, probably since uptime and libident.so.0 were called in and endless loop from the clients, the nfs-servers log was filled with those messages and I had to stop the nfsd and do the cp- and mv-procedure for those files.
Hm.
Quoted 4 lines
Quoted 1 line
Does reiserfsck have found anything?
As I said, the backup script runs a reiserfsck itself and found no problems, I hope there is no corruption after a simple boot, but I will check this later on this day.
Ok, let us know of the results.
Quoted 4 lines
Quoted 2 lines
We do not yet understand on how to reproduce that locally, because this message indicates pretty strange conditions.
Is there anything I can do to debug this, when I observe this phenomena the next time (e.g. enabling nfs-debugging via proc, etc) ?
Please try to reboot the server not changing fs, if the problem still persists, then take FS metadata snapshot (debugreiserfs -p /dev/device | bzip2 -9c >metadata.bz2, use recent reiserfsprogs please) and make it available for us to download, please.
Thank you.
Bye,
Oleg
Hello,
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Does reiserfsck have found anything?
As I said, the backup script runs a reiserfsck itself and found no problems, I hope there is no corruption after a simple boot, but I will check this later on this day.
Ok, let us know of the results.
As I expected, 'reiserfsck --check' didn't find any problems.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
We do not yet understand on how to reproduce that locally, because this message indicates pretty strange conditions.
Quoted 8 lines
Quoted 2 lines
Is there anything I can do to debug this, when I observe this phenomena the next time (e.g. enabling nfs-debugging via proc, etc) ?
Please try to reboot the server not changing fs, if the problem still persists, then take FS metadata snapshot (debugreiserfs -p
/dev/device| bzip2 -9c >metadata.bz2, use recent reiserfsprogs please) and make it available for us to download, please.
As noted in my other e-email, /usr/sbin/logrotate was also affected. I don't like it to say, but after rebooting everything was fine, so those messages doesn't appear any longer.
Does this mean memory problems again ? We even have loaded the ecc-kernel-module since last week, to be able to problems befor the filesystem is affected, but it didn't show any memory-problem on this machine.
Or could it be that we have 3GB RAM and the vanilla kernel is not suitable for this (I read something like this in the LKML, but can't remember the details).
Thanks,
Bernd
Hello!
Quoted 2 lines · Bernd Schubert
Quoted 1 line
Ok, let us know of the results.
As I expected, 'reiserfsck --check' didn't find any problems.
Ok.
Quoted 4 lines
As noted in my other e-email,
/usr/sbin/logrotatewas also affected. I don't like it to say, but after rebooting everything was fine, so those messages doesn't appear any longer.
Does this mean memory problems again ? We even have loaded the
Not likely.
Quoted 6 lines
ecc-kernel-module since last week, to be able to problems befor the filesystem is affected, but it didn't show any memory-problem on this machine.
Or could it be that we have 3GB RAM and the vanilla kernel is not suitable for this (I read something like this in the LKML, but can't remember the details).
The problems seems to have something to do with strange dentries appearing in dentry cache, also you have verified that this is not because of fs error.
What kernel are you running?
I think may be race with iget4 might cause this, but I am not sure.
We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Bye,
Oleg
Hello,
Quoted 6 lines
Quoted 4 lines
As noted in my other e-email,
/usr/sbin/logrotatewas also affected. I don't like it to say, but after rebooting everything was fine, so those messages doesn't appear any longer.
Does this mean memory problems again ? We even have loaded theNot likely.
The first good message this day! :) I was really worried again.
Quoted 5 lines
The problems seems to have something to do with strange dentries appearing in dentry cache, also you have verified that this is not because of fs error.
What kernel are you running?
2.4.20 with the ptrace patch.
Quoted 3 lines
I think may be race with iget4 might cause this, but I am not sure. We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?
The problems is to detect if this is really caused by this race. Since I still don't know a way how to reliable trigger this and even a reboot can fix it, it is difficult to get to know if the patch would be really helpful. Do you see a way to enable your patch via proc interface ? So I could try to reboot the server and run 'find /' on the client as loop until the problem occurs. When I see the problem, I could enable it via proc and check if it works.
Update: While I was writing and thinking about how to trigger it, I just again saw the problem for /usr/bin/uptime and another file and again a reboot could fix it for those files.
Thanks a lot for your help,
Bernd
Hello!
Quoted 5 lines · Bernd Schubert
Quoted 4 lines
The problems seems to have something to do with strange dentries appearing in dentry cache, also you have verified that this is not because of fs error.
What kernel are you running?2.4.20 with the ptrace patch.
Ok.
Quoted 7 lines
Quoted 3 lines
I think may be race with iget4 might cause this, but I am not sure. We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?
See the patch below.
It should not break anything.
Quoted 1 line
The problems is to detect if this is really caused by this race. Since I still
Well, race is of type when several parallel processes try to access the file whose inode is not in memory.
This resembles what you describe with lots of clients accessing same file over NFS at the same time.
Quoted 3 lines
Update: While I was writing and thinking about how to trigger it, I just again saw the problem for
/usr/bin/uptimeand another file and again a reboot could fix it for those files.
Bye,
Oleg
===== Documentation/filesystems/Locking 1.5 vs edited =====
Documentation/filesystems/Locking +1 -1
@@ -112,7 +112,7 @@ remount_fs: yes yes maybe (see below) umount_begin: yes no maybe (see below) -->read_inode() is not a method - it's a callback used in iget()/iget4(). +->read_inode() is not a method - it's a callback used in iget(). rules for mount_sem are not too nice - it is going to die and be replaced by better scheme anyway.
===== fs/Makefile 1.16 vs edited =====
fs/Makefile +1 -1
@@ -7,7 +7,7 @@ O_TARGET := fs.o -export-objs := filesystems.o open.o dcache.o buffer.o +export-objs := filesystems.o open.o dcache.o buffer.o inode.o mod-subdirs := nls obj-y := open.o read_write.o devices.o file_table.o buffer.o \
===== fs/inode.c 1.35 vs edited =====
fs/inode.c +274 -40
418 lines not on this page · raw message
===== fs/coda/cnode.c 1.8 vs edited =====
fs/coda/cnode.c +41 -47
151 lines not on this page · raw message
===== fs/coda/inode.c 1.9 vs edited =====
fs/coda/inode.c +0 -20
@@ -34,7 +34,6 @@/* VFS super_block ops */ static struct super_block *coda_read_super (struct super_block *,void *,int ); -static void coda_read_inode (struct inode *);static void coda_clear_inode (struct inode *);static void coda_put_super (struct super_block *);static int coda_statfs (struct super_block *sb,struct statfs *buf);
@@ -42,7 +41,6 @@/* exported operations */ struct super_operations coda_super_operations = { - read_inode: coda_read_inode, clear_inode: coda_clear_inode, put_super: coda_put_super, statfs: coda_statfs,
@@ -179,24 +177,6 @@printk ("Coda: Bye bye.\n" );kfree (sbi); -} - -/* all filling in of inodes postponed until lookup */ -static void coda_read_inode (struct inode *inode) -{ -struct coda_sb_info *sbi =coda_sbp (inode->i_sb); -struct coda_inode_info *cii; - -if (!sbi)BUG (); - - cii =ITOC (inode); -if (!coda_isnullfid (&cii->c_fid)) { -printk ("coda_read_inode: initialized inode" ); -return ; - } - - cii->c_mapcount =0 ; -list_add (&cii->c_cilist, &sbi->sbi_cihead); }static void coda_clear_inode (struct inode *inode)
===== fs/nfs/inode.c 1.18 vs edited =====
fs/nfs/inode.c +34 -34
126 lines not on this page · raw message
===== fs/reiserfs/inode.c 1.39 vs edited =====
fs/reiserfs/inode.c +29 -27
122 lines not on this page · raw message
===== fs/reiserfs/super.c 1.27 vs edited =====
fs/reiserfs/super.c +9 -5
@@ -381,8 +381,6 @@struct super_operations reiserfs_sops = { - read_inode: reiserfs_read_inode, - read_inode2: reiserfs_read_inode2, write_inode: reiserfs_write_inode, dirty_inode: reiserfs_dirty_inode, delete_inode: reiserfs_delete_inode,
@@ -1117,7 +1115,7 @@int old_format =0 ;unsigned long blocks;int jinit_done =0 ; -struct reiserfs_iget4_args args ; +struct reiserfs_iget_args args ;int old_magic;struct reiserfs_super_block * rs;
@@ -1194,11 +1192,17 @@printk ("clm-7000: Detected readonly device, marking FS readonly\n" ) ; s->s_flags |=MS_RDONLY ; } - args.objectid =REISERFS_ROOT_PARENT_OBJECTID ; - root_inode =iget4 (s,REISERFS_ROOT_OBJECTID ,0 , (void *)(&args)); + args.objectid =REISERFS_ROOT_OBJECTID ; + args.dirid =REISERFS_ROOT_PARENT_OBJECTID ; + root_inode =iget5_locked (s,REISERFS_ROOT_OBJECTID , reiserfs_find_actor, reiserfs_init_locked_inode, (void *)(&args));if (!root_inode) {printk ("reiserfs_read_super: get root inode failed\n" ); goto error; + } + +if (root_inode->i_state &I_NEW ) { +reiserfs_read_locked_inode (root_inode, &args); +unlock_new_inode (root_inode); } s->s_root =d_alloc_root (root_inode);
===== include/linux/fs.h 1.69 vs edited =====
include/linux/fs.h +22 -11
@@ -881,13 +881,6 @@struct super_operations {void (*read_inode) (struct inode *); -/* reiserfs kludge. reiserfs needs 64 bits of information to -** find an inode. We are using the read_inode2 call to get -** that information. We don't like this, and are waiting on some -** VFS changes for the real solution. -** iget4 calls read_inode2, iff it is defined -*/ -void (*read_inode2) (struct inode *,void *) ;void (*dirty_inode) (struct inode *);void (*write_inode) (struct inode *,int );void (*put_inode) (struct inode *);
@@ -935,6 +928,7 @@#define I_LOCK 8#define I_FREEING 16#define I_CLEAR 32 +#define I_NEW 64#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
@@ -1347,11 +1341,24 @@extern struct inode *igrab (struct inode *);extern ino_t iunique (struct super_block *,ino_t ); -typedef int (*find_inode_t )(struct inode *,unsigned long ,void *); -extern struct inode *iget4 (struct super_block *,unsigned long ,find_inode_t ,void *); +extern struct inode *ilookup5 (struct super_block *sb,unsigned long hashval, +int (*test)(struct inode *,void *),void *data); +extern struct inode *ilookup (struct super_block *sb,unsigned long ino); + +extern struct inode *iget5_locked (struct super_block *,unsigned long ,int (*test)(struct inode *,void *),int (*set)(struct inode *,void *),void *); +extern struct inode *iget_locked (struct super_block *,unsigned long ); +extern void unlock_new_inode (struct inode *); +static inline struct inode *iget (struct super_block *sb,unsigned long ino) { -return iget4 (sb, ino,NULL ,NULL ); +struct inode *inode =iget_locked (sb, ino); + +if (inode && (inode->i_state &I_NEW )) { + sb->s_op->read_inode (inode); +unlock_new_inode (inode); + } + +return inode; }extern void clear_inode (struct inode *);
@@ -1369,8 +1376,12 @@ }extern void remove_suid (struct inode *inode); -extern void insert_inode_hash (struct inode *); +extern void __insert_inode_hash (struct inode *,unsigned long hashval);extern void remove_inode_hash (struct inode *); +static inline void insert_inode_hash (struct inode *inode) { +__insert_inode_hash (inode, inode->i_ino); +} +extern struct file *get_empty_filp (void );extern void file_move (struct file *f,struct list_head *list);extern struct buffer_head *get_hash_table (kdev_t ,int ,int );
===== include/linux/reiserfs_fs.h 1.25 vs edited =====
include/linux/reiserfs_fs.h +5 -3
@@ -1478,8 +1478,9 @@#define B_I_POS_UNFM_POINTER (bh,ih,pos) le32_to_cpu(*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)))#define PUT_B_I_POS_UNFM_POINTER (bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0) -struct reiserfs_iget4_args { +struct reiserfs_iget_args {__u32 objectid ; +__u32 dirid ; } ;/***************************************************************************/
@@ -1730,8 +1731,9 @@/* inode.c */ -void reiserfs_read_inode (struct inode * inode) ; -void reiserfs_read_inode2 (struct inode * inode,void *p) ; +void reiserfs_read_locked_inode (struct inode * inode,struct reiserfs_iget_args *args) ; +int reiserfs_find_actor (struct inode * inode,void *p) ; +int reiserfs_init_locked_inode (struct inode * inode,void *p) ;void reiserfs_delete_inode (struct inode * inode);void reiserfs_write_inode (struct inode * inode,int ) ; struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
===== kernel/ksyms.c 1.64 vs edited =====
kernel/ksyms.c +1 -2
@@ -140,7 +140,6 @@EXPORT_SYMBOL (fget);EXPORT_SYMBOL (igrab);EXPORT_SYMBOL (iunique); -EXPORT_SYMBOL (iget4);EXPORT_SYMBOL (iput);EXPORT_SYMBOL (force_delete);EXPORT_SYMBOL (follow_up);
@@ -524,7 +523,7 @@EXPORT_SYMBOL (read_ahead);EXPORT_SYMBOL (get_hash_table);EXPORT_SYMBOL (get_empty_inode); -EXPORT_SYMBOL (insert_inode_hash); +EXPORT_SYMBOL (__insert_inode_hash);EXPORT_SYMBOL (remove_inode_hash);EXPORT_SYMBOL (buffer_insert_inode_queue);EXPORT_SYMBOL (buffer_insert_inode_data_queue);
Hello!
Quoted 2 lines
See the patch below.
It should not break anything.
Thanks a lot for the patch, I'm going to test it tomorrow.
Quoted 8 lines
Quoted 3 lines
The problems is to detect if this is really caused by this race. Since I still
Well, race is of type when several parallel processes try to access the file whose inode is not in memory.
This resembles what you describe with lots of clients accessing same file over NFS at the same time.
Ah, good to know, so I could trigger this when I write a script that reads a file on the server as endless loop. Runing this on all clients and then rebooting server, should cause a problem for this file, shouldn't it ? This way we could prove that the patch helps.
Best regards,
Bernd
Quoted 10 lines · Oleg Drokin
Hello!
Quoted 5 lines · Bernd Schubert
Quoted 4 lines
The problems seems to have something to do with strange dentries appearing in dentry cache, also you have verified that this is not because of fs error.
What kernel are you running?2.4.20 with the ptrace patch.
Ok.
here it is 2.4.20 with ext3 umount patch.
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
I think may be race with iget4 might cause this, but I am not sure. We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?See the patch below.
It should not break anything.
Well, we keep getting this error in massess too... and in our case it is very likely that clients access the same file from all the clients...
However I cannot quickly test that atm but if it is really safe I might test it next week.
Soeren.
Hello!
Quoted 11 lines · Soeren Sonnenburg
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
I think may be race with iget4 might cause this, but I am not sure. We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?See the patch below.
It should not break anything.Well, we keep getting this error in massess too... and in our case it is very likely that clients access the same file from all the clients...
Are all of your NFS exports where these errors happens reiserfs?
Quoted 2 lines
However I cannot quickly test that atm but if it is really safe I might test it next week.
Well, there is a problem reported with that 2.4.20 backport, that I am going to look into. If you can try 2.4.21-pre6 with iget5_locked.diff (I just sent to the list in this same thread) that would be great.
Thank you.
Bye,
Oleg
Quoted 10 lines · Oleg Drokin
Hello!
Quoted 7 lines · Soeren Sonnenburg
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
I think may be race with iget4 might cause this, but I am not sure. We have a patch for this iget4 race, and if you are willing to test it, I can send it to you.
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
See the patch below.
It should not break anything.Well, we keep getting this error in massess too... and in our case it is very likely that clients access the same file from all the clients...
Are all of your NFS exports where these errors happens reiserfs?
This is the same machine I was telling you about on lkml ... The errors I got now are all on the most actively used nfs share which uses reiserfs as the underlying filesystem.
Quoted 8 lines
Quoted 2 lines
However I cannot quickly test that atm but if it is really safe I might test it next week.
Well, there is a problem reported with that 2.4.20 backport, that I am going to look into. If you can try 2.4.21-pre6 with iget5_locked.diff (I just sent to the list in this same thread) that would be great.
Thank you.
well, I can't do experimental testing as there are like 40 diskless machines using
that disk ... I could somewhen in the evening/night do some stress test but thats it...
Soeren
Quoted 3 lines
Bye,
Oleg
Hello!
Quoted 10 lines · Soeren Sonnenburg
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Yes of course I am. I hope the other admins won't kill me, but I guess they know that I willing to do experiments from time to time ;-)
Could something worse happen when I try the patch, that could not be fixed by simple rebooting ?See the patch below.
It should not break anything.Well, we keep getting this error in massess too... and in our case it is very likely that clients access the same file from all the clients...
Are all of your NFS exports where these errors happens reiserfs?
This is the same machine I was telling you about on lkml ...
Ah, ok.
Quoted 4 lines
well, I can't do experimental testing as there are like 40 diskless machines using
that disk ... I could somewhen in the evening/night do some stress test but thats it...
Ok, I understand. Well, I guess I will spend some time on this iget5 2.4.20 backport and on trying to reproduce the problem locally.
Bye,
Oleg
Hello!
Quoted 3 lines
See the patch below.
It should not break anything.
I just tried to cause the problems again, but without any success. I simply don't get the messages today. I tried to call /usr/bin/uptime from all clients as endless loop, rebooted the server -- no success. Then I stopped the nfs-server, copied uptime to uptime.old, removed uptime and moved uptime.old to uptime (to make the filehandle invalid) and rebooted -- still no success. I also tried several other things, but none of them helped.
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls {mountdir}' returns 'Unknown error 524' (or was it 542 I can't remember). So even my homedirectory was not available on the server when I tried the iget-patch.
Well on system-reboot there I also get an oops. I have attached the ksymoops output.
Best regards,
Bernd
ksymoops 2.4.8 on i686 2.4.20-athlon-pp. Options used
-v vmlinux__2.4.20-athlon-pp-igetp (specified)
-K (specified)
-L (specified)
-o /lib/modules/2.4.20-athlon-pp-igetp/ (specified)
-m System.map__2.4.20-athlon-pp-igetp (specified)No modules in ksyms, skipping objects
Mar 30 16:21:38 hamilton kernel: kernel BUG at inode.c:1268! Mar 30 16:21:38 hamilton kernel: invalid operand: 0000 Mar 30 16:21:38 hamilton kernel: CPU: 0 Mar 30 16:21:38 hamilton kernel: EIP: 0010:[<c0149870>] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 Mar 30 16:21:38 hamilton kernel: EFLAGS: 00010246 Mar 30 16:21:38 hamilton kernel: eax: f6dc6280 ebx: f6dc6280 ecx: f89afad4 edx: f6dc63a0 Mar 30 16:21:38 hamilton kernel: esi: f6d82400 edi: 00000000 ebp: 080551f0 esp: f6d21f28 Mar 30 16:21:38 hamilton kernel: ds: 0018 es: 0018 ss: 0018 Mar 30 16:21:38 hamilton kernel: Process umount (pid: 892, stackpage=f6d21000) Mar 30 16:21:38 hamilton kernel: Stack: f89afad4 f6d824d4 f89afca0 f89a930d f6dc6280 f6d82400 f89a9df8 f6dc6280 Mar 30 16:21:38 hamilton kernel: f6d82400 f6d82444 c013b3e1 f6d82400 c342a540 f6d82400 0804ffd8 c014af0e Mar 30 16:21:38 hamilton kernel: f6d82400 c342a540 f744bc40 f6d21f98 00000000 c013f067 c342a540 f6d21f98 Mar 30 16:21:38 hamilton kernel: Call Trace: [<f89afad4>] [<f89afca0>] [<f89a930d>] [<f89a9df8>] [<c013b3e1>] Mar 30 16:21:38 hamilton kernel: [<c014af0e>] [<c013f067>] [<c014b5af>] [<c01283b5>] [<c014b5cc>] [<c0108837>] Mar 30 16:21:38 hamilton kernel: Code: 0f 0b f4 04 bd 0b 27 c0 85 f6 74 03 8b 7e 20 85 ff 74 0d 8b
Quoted 1 line
Quoted 1 line
EIP;
c0149870<iput+20/200> <=====
Trace; f89afad4 <END_OF_CODE+3865ec30/????>
Trace; f89afca0 <END_OF_CODE+3865edfc/????>
Trace; f89a930d <END_OF_CODE+38658469/????>
Trace; f89a9df8 <END_OF_CODE+38658f54/????>
Trace; c013b3e1 <kill_super+a1/e0>
Trace; c014af0e <__mntput+1e/30>
Trace; c013f067 <path_release+27/30>
Trace; c014b5af <sys_umount+6f/80>
Trace; c01283b5 <sys_munmap+35/60>
Trace; c014b5cc <sys_oldumount+c/10>
Trace; c0108837 <system_call+33/38>
Code; c0149870 <iput+20/200>
00000000 <_EIP>:
Code; c0149870 <iput+20/200> <=====
0: 0f 0b ud2a <=====
Code; c0149872 <iput+22/200>
2: f4 hlt
Code; c0149873 <iput+23/200>
3: 04 bd add $0xbd,%al
Code; c0149875 <iput+25/200>
5: 0b 27 or (%edi),%esp
Code; c0149877 <iput+27/200>
7: c0 85 f6 74 03 8b 7e rolb $0x7e,0x8b0374f6(%ebp)
Code; c014987e <iput+2e/200>
e: 20 85 ff 74 0d 8b and %al,0x8b0d74ff(%ebp)
Hello!
Quoted 4 lines · Bernd Schubert
Quoted 2 lines
See the patch below.
It should not break anything.I just tried to cause the problems again, but without any success. I simply don't get the messages today. I tried to call
/usr/bin/uptimefrom all
This is probably confirms that the problem is a race of some kind.
Quoted 5 lines
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls {mountdir}' returns 'Unknown error 524' (or was it 542 I can't remember). So even my homedirectory was not available on the server when I tried the iget-patch.
Hm. This is strange.
While backporting iget5_locked patch, the only conflicts were in core fs stuff, NFS-client part of the patch is the same as in patch for 2.4.21-pre6, and our tester have found zero problems with the patch on 2.4.21-pre6.
Quoted 2 lines
Well on system-reboot there I also get an oops. I have attached the ksymoops output.
Ok, I will try to reproduce that.
Meanwhile, if you can try 2.4.21-pre6 with attached patch, that would be great.
Thank you.
Bye,
Oleg
===== Documentation/filesystems/Locking 1.7 vs edited =====
Documentation/filesystems/Locking +1 -1
@@ -114,7 +114,7 @@ remount_fs: yes yes maybe (see below) umount_begin: yes no maybe (see below) -->read_inode() is not a method - it's a callback used in iget()/iget4(). +->read_inode() is not a method - it's a callback used in iget(). rules for mount_sem are not too nice - it is going to die and be replaced by better scheme anyway.
===== fs/Makefile 1.16 vs edited =====
fs/Makefile +1 -1
@@ -7,7 +7,7 @@ O_TARGET := fs.o -export-objs := filesystems.o open.o dcache.o buffer.o +export-objs := filesystems.o open.o dcache.o buffer.o inode.o mod-subdirs := nls obj-y := open.o read_write.o devices.o file_table.o buffer.o \
===== fs/inode.c 1.36 vs edited =====
fs/inode.c +279 -39
414 lines not on this page · raw message
===== fs/coda/cnode.c 1.8 vs edited =====
fs/coda/cnode.c +41 -47
151 lines not on this page · raw message
===== fs/coda/inode.c 1.9 vs edited =====
fs/coda/inode.c +0 -20
@@ -34,7 +34,6 @@/* VFS super_block ops */ static struct super_block *coda_read_super (struct super_block *,void *,int ); -static void coda_read_inode (struct inode *);static void coda_clear_inode (struct inode *);static void coda_put_super (struct super_block *);static int coda_statfs (struct super_block *sb,struct statfs *buf);
@@ -42,7 +41,6 @@/* exported operations */ struct super_operations coda_super_operations = { - read_inode: coda_read_inode, clear_inode: coda_clear_inode, put_super: coda_put_super, statfs: coda_statfs,
@@ -179,24 +177,6 @@printk ("Coda: Bye bye.\n" );kfree (sbi); -} - -/* all filling in of inodes postponed until lookup */ -static void coda_read_inode (struct inode *inode) -{ -struct coda_sb_info *sbi =coda_sbp (inode->i_sb); -struct coda_inode_info *cii; - -if (!sbi)BUG (); - - cii =ITOC (inode); -if (!coda_isnullfid (&cii->c_fid)) { -printk ("coda_read_inode: initialized inode" ); -return ; - } - - cii->c_mapcount =0 ; -list_add (&cii->c_cilist, &sbi->sbi_cihead); }static void coda_clear_inode (struct inode *inode)
===== fs/nfs/inode.c 1.18 vs edited =====
fs/nfs/inode.c +34 -34
126 lines not on this page · raw message
===== fs/reiserfs/inode.c 1.42 vs edited =====
fs/reiserfs/inode.c +29 -27
122 lines not on this page · raw message
===== fs/reiserfs/super.c 1.27 vs edited =====
fs/reiserfs/super.c +9 -5
@@ -381,8 +381,6 @@struct super_operations reiserfs_sops = { - read_inode: reiserfs_read_inode, - read_inode2: reiserfs_read_inode2, write_inode: reiserfs_write_inode, dirty_inode: reiserfs_dirty_inode, delete_inode: reiserfs_delete_inode,
@@ -1117,7 +1115,7 @@int old_format =0 ;unsigned long blocks;int jinit_done =0 ; -struct reiserfs_iget4_args args ; +struct reiserfs_iget_args args ;int old_magic;struct reiserfs_super_block * rs;
@@ -1194,11 +1192,17 @@printk ("clm-7000: Detected readonly device, marking FS readonly\n" ) ; s->s_flags |=MS_RDONLY ; } - args.objectid =REISERFS_ROOT_PARENT_OBJECTID ; - root_inode =iget4 (s,REISERFS_ROOT_OBJECTID ,0 , (void *)(&args)); + args.objectid =REISERFS_ROOT_OBJECTID ; + args.dirid =REISERFS_ROOT_PARENT_OBJECTID ; + root_inode =iget5_locked (s,REISERFS_ROOT_OBJECTID , reiserfs_find_actor, reiserfs_init_locked_inode, (void *)(&args));if (!root_inode) {printk ("reiserfs_read_super: get root inode failed\n" ); goto error; + } + +if (root_inode->i_state &I_NEW ) { +reiserfs_read_locked_inode (root_inode, &args); +unlock_new_inode (root_inode); } s->s_root =d_alloc_root (root_inode);
===== include/linux/fs.h 1.74 vs edited =====
include/linux/fs.h +22 -11
@@ -885,13 +885,6 @@void (*read_inode) (struct inode *); -/* reiserfs kludge. reiserfs needs 64 bits of information to -** find an inode. We are using the read_inode2 call to get -** that information. We don't like this, and are waiting on some -** VFS changes for the real solution. -** iget4 calls read_inode2, iff it is defined -*/ -void (*read_inode2) (struct inode *,void *) ;void (*dirty_inode) (struct inode *);void (*write_inode) (struct inode *,int );void (*put_inode) (struct inode *);
@@ -940,6 +933,7 @@#define I_LOCK 8#define I_FREEING 16#define I_CLEAR 32 +#define I_NEW 64#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
@@ -1378,19 +1372,36 @@extern struct inode *igrab (struct inode *);extern ino_t iunique (struct super_block *,ino_t ); -typedef int (*find_inode_t )(struct inode *,unsigned long ,void *); -extern struct inode *iget4 (struct super_block *,unsigned long ,find_inode_t ,void *); +extern struct inode *ilookup5 (struct super_block *sb,unsigned long hashval, +int (*test)(struct inode *,void *),void *data); +extern struct inode *ilookup (struct super_block *sb,unsigned long ino); + +extern struct inode *iget5_locked (struct super_block *,unsigned long ,int (*test)(struct inode *,void *),int (*set)(struct inode *,void *),void *); +extern struct inode *iget_locked (struct super_block *,unsigned long ); +extern void unlock_new_inode (struct inode *); +static inline struct inode *iget (struct super_block *sb,unsigned long ino) { -return iget4 (sb, ino,NULL ,NULL ); +struct inode *inode =iget_locked (sb, ino); + +if (inode && (inode->i_state &I_NEW )) { + sb->s_op->read_inode (inode); +unlock_new_inode (inode); + } + +return inode; }extern void clear_inode (struct inode *);extern struct inode *new_inode (struct super_block *sb);extern void remove_suid (struct inode *inode); -extern void insert_inode_hash (struct inode *); +extern void __insert_inode_hash (struct inode *,unsigned long hashval);extern void remove_inode_hash (struct inode *); +static inline void insert_inode_hash (struct inode *inode) { +__insert_inode_hash (inode, inode->i_ino); +} +extern struct file *get_empty_filp (void );extern void file_move (struct file *f,struct list_head *list);extern struct buffer_head *get_hash_table (kdev_t ,int ,int );
===== include/linux/reiserfs_fs.h 1.26 vs edited =====
include/linux/reiserfs_fs.h +5 -3
@@ -1478,8 +1478,9 @@#define B_I_POS_UNFM_POINTER (bh,ih,pos) le32_to_cpu(*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)))#define PUT_B_I_POS_UNFM_POINTER (bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0) -struct reiserfs_iget4_args { +struct reiserfs_iget_args {__u32 objectid ; +__u32 dirid ; } ;/***************************************************************************/
@@ -1730,8 +1731,9 @@/* inode.c */ -void reiserfs_read_inode (struct inode * inode) ; -void reiserfs_read_inode2 (struct inode * inode,void *p) ; +void reiserfs_read_locked_inode (struct inode * inode,struct reiserfs_iget_args *args) ; +int reiserfs_find_actor (struct inode * inode,void *p) ; +int reiserfs_init_locked_inode (struct inode * inode,void *p) ;void reiserfs_delete_inode (struct inode * inode);void reiserfs_write_inode (struct inode * inode,int ) ; struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
===== kernel/ksyms.c 1.67 vs edited =====
kernel/ksyms.c +1 -2
@@ -140,7 +140,6 @@EXPORT_SYMBOL (fget);EXPORT_SYMBOL (igrab);EXPORT_SYMBOL (iunique); -EXPORT_SYMBOL (iget4);EXPORT_SYMBOL (iput);EXPORT_SYMBOL (inode_init_once);EXPORT_SYMBOL (force_delete);
@@ -528,7 +527,7 @@EXPORT_SYMBOL (read_ahead);EXPORT_SYMBOL (get_hash_table);EXPORT_SYMBOL (new_inode); -EXPORT_SYMBOL (insert_inode_hash); +EXPORT_SYMBOL (__insert_inode_hash);EXPORT_SYMBOL (remove_inode_hash);EXPORT_SYMBOL (buffer_insert_list);EXPORT_SYMBOL (make_bad_inode);
Hello!
Quoted 2 lines · Bernd Schubert
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls
Ah, stupid me.
I have another patch that we created before iget5_locked backport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.
Bye,
Oleg
===== fs/reiserfs/inode.c 1.42 vs edited =====
fs/reiserfs/inode.c +24 -2
@@ -20,6 +20,10 @@static int reiserfs_get_block (struct inode * inode,long block,struct buffer_head * bh_result,int create); +/* This spinlock guards inode pkey in private part of inode +against race between find_actor() vs reiserfs_read_inode2 */ +static spinlock_t keycopy_lock =SPIN_LOCK_UNLOCKED ; +void reiserfs_delete_inode (struct inode * inode) {int jbegin_count =JOURNAL_PER_BALANCE_CNT *2 ;
@@ -898,8 +902,9 @@ bh =PATH_PLAST_BUFFER (path); ih =PATH_PITEM_HEAD (path); - +spin_lock (&keycopy_lock);copy_key (INODE_PKEY (inode), &(ih->ih_key)); +spin_unlock (&keycopy_lock); inode->i_blksize =PAGE_SIZE ;INIT_LIST_HEAD (&inode->u.reiserfs_i.i_prealloc_list) ;
@@ -1220,10 +1225,27 @@ unsigned long inode_no, void *opaque ) { struct reiserfs_iget4_args *args; +int retval; args = opaque; +/* We protect against possible parallel init_inode() on another CPU here. */ +spin_lock (&keycopy_lock);/* args is already in CPU order */ -return le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid; +if (le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid) + retval =1 ; +else +/* If The key does not match, lets see if we are racing +with another iget4, that already progressed so far +to reiserfs_read_inode2() and was preempted in +call to search_by_key(). The signs of that are: +Inode is locked +dirid and object id are zero (not yet initialized)*/ + retval = (inode->i_state &I_LOCK ) && + !INODE_PKEY (inode)->k_dir_id && + !INODE_PKEY (inode)->k_objectid; + +spin_unlock (&keycopy_lock); +return retval; }struct inode *reiserfs_iget (struct super_block * s,const struct cpu_key * key)
Quoted 7 lines · Oleg Drokin
Hello!
Quoted 2 lines · Bernd Schubert
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls
Quoted 8 lines
Ah, stupid me.
I have another patch that we created beforeiget5_lockedbackport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.
Err, sorry but I have to ask again:
This problem needs a patch on the server only - yes ?
Then I will at least patch+compile the kernel.
Soeren.
Hello!
Quoted 8 lines · Soeren Sonnenburg
Quoted 6 lines
I have another patch that we created before
iget5_lockedbackport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.Err, sorry but I have to ask again:
This problem needs a patch on the server only - yes ?
Yes. Well, may be this race is not the cause of the problem you are observing, but prerequisites are similar, so we'd better make sure this is different problem.
Quoted 1 line
Then I will at least patch+compile the kernel.
Thank you.
Bye,
Oleg
Quoted 5 lines · Oleg Drokin
Quoted 2 lines
Err, sorry but I have to ask again:
This problem needs a patch on the server only - yes ?Yes. Well, may be this race is not the cause of the problem you are observing, but prerequisites are similar, so we'd better make sure this is different problem.
well I know that these files were accessed simultanously from a number of clients... so it is very likely that this is the same bug...
Quoted 3 lines
Quoted 1 line
Then I will at least patch+compile the kernel.
Thank you.
will install this kernel tuesday night (tomorrow) and run some test too.
we will know wednesday if that was the cause.
Soeren.
Hello!
On Mon, Mar 31, 2003 at 03:28:54PM +0200, Soeren Sonnenburg wrote:
Hmm....
Now this explains why I have not got some of the mails you have referred to. Seems that somebody turned off some mailserver with nonempty mailqueue and turned it on only now ;)
Bye,
Oleg
On Monday 31 March 2003 12:24, Oleg Drokin wrote:
Hello Oleg!
Quoted 12 lines · Bernd Schubert
Quoted 2 lines
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls
Ah, stupid me.
I have another patch that we created beforeiget5_lockedbackport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.
Thanks a lot for both new patches, I will try them as soon as possible, though it is usually more difficult to reboot during the week (so it may become the next weekend, before I can try it). Anyway I will also try it on our data server, where we also see those messages from time to time, even without rebooting.
Best regards,
Bernd
Quoted 8 lines · Oleg Drokin
Hello!
Quoted 1 line · Bernd Schubert
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls
Quoted 7 lines
Ah, stupid me.
I have another patch that we created beforeiget5_lockedbackport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.
I just got an "nfsd-fh: found a name that I didn't expect" yesterday. I'm using a Red Hat 2.4.20 RPM with 2.4.20-pending+data-logging+quota. Should I apply just this patch or both this patch and the iget5_locked_2.4.20 patch?
Thanks,
John Dalbec
Quoted 59 lines
Bye,
Oleg=====
fs/reiserfs/inode.c1.42 vs edited =====fs/reiserfs/inode.c +24
-2@@ -20,6 +20,10 @@static int reiserfs_get_block (struct inode * inode,long block,struct buffer_head * bh_result,int create); +/* This spinlock guards inode pkey in private part of inode +against race between find_actor() vs reiserfs_read_inode2 */ +static spinlock_t keycopy_lock =SPIN_LOCK_UNLOCKED ; +void reiserfs_delete_inode (struct inode * inode) {int jbegin_count =JOURNAL_PER_BALANCE_CNT *2 ;@@ -898,8 +902,9 @@ bh =PATH_PLAST_BUFFER (path); ih =PATH_PITEM_HEAD (path); - +spin_lock (&keycopy_lock);copy_key (INODE_PKEY (inode), &(ih->ih_key)); +spin_unlock (&keycopy_lock); inode->i_blksize =PAGE_SIZE ;INIT_LIST_HEAD (&inode->u.reiserfs_i.i_prealloc_list) ;@@ -1220,10 +1225,27 @@ unsigned long inode_no, void *opaque ) { struct reiserfs_iget4_args *args; +int retval; args = opaque; +/* We protect against possible parallel init_inode() on another CPU here. */ +spin_lock (&keycopy_lock);/* args is already in CPU order */ -return le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid; +if (le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid) + retval =1 ; +else +/* If The key does not match, lets see if we are racing +with another iget4, that already progressed so far +to reiserfs_read_inode2() and was preempted in +call to search_by_key(). The signs of that are: +Inode is locked +dirid and object id are zero (not yet initialized)*/ + retval = (inode->i_state &I_LOCK ) && + !INODE_PKEY (inode)->k_dir_id && + !INODE_PKEY (inode)->k_objectid; + +spin_unlock (&keycopy_lock); +return retval; }struct inode *reiserfs_iget (struct super_block * s,const struct cpu_key * key)
Quoted 15 lines · John Dalbec
Quoted 6 lines · Oleg Drokin
Hello!
Quoted 2 lines · Bernd Schubert
Anyway I also tested the kernel-patch, but it causes problems with mounts from another nfs-server. Well, mounting works fine, but e.g. running 'ls
Quoted 7 lines
Ah, stupid me.
I have another patch that we created beforeiget5_lockedbackport. It's a bit of hack to beat the race, but it works (fixes the race). It does not touch any code outside of reiserfs.
So if you apply that to 2.4.20 and see if you still can see the NFS problem over time...
Patch is below.
Quoted 6 lines
I just got an "nfsd-fh: found a name that I didn't expect" yesterday. I'm using a Red Hat 2.4.20 RPM with 2.4.20-pending+data-logging+quota. Should I apply just this patch or both this patch and the iget5_locked_2.4.20 patch?
Thanks,
John Dalbec
Hi,
only the patch below!
Don't install the iget5_locked_2.4.20 patch as it may cause problems with imports from other nfs-servers.
Bernd
Quoted 59 lines
Quoted 59 lines
Bye,
Oleg=====
fs/reiserfs/inode.c1.42 vs edited =====fs/reiserfs/inode.c +23
-2@@ -20,6 +20,10 @@static int reiserfs_get_block (struct inode * inode,long block,struct buffer_head * bh_result,int create); +/* This spinlock guards inode pkey in private part of inode +against race between find_actor() vs reiserfs_read_inode2 */ +static spinlock_t keycopy_lock =SPIN_LOCK_UNLOCKED ; +void reiserfs_delete_inode (struct inode * inode) {int jbegin_count =JOURNAL_PER_BALANCE_CNT *2 ;@@ -898,8 +902,9 @@ bh =PATH_PLAST_BUFFER (path); ih =PATH_PITEM_HEAD (path); - +spin_lock (&keycopy_lock);copy_key (INODE_PKEY (inode), &(ih->ih_key)); +spin_unlock (&keycopy_lock); inode->i_blksize =PAGE_SIZE ;INIT_LIST_HEAD (&inode->u.reiserfs_i.i_prealloc_list) ;@@ -1220,10 +1225,27 @@ unsigned long inode_no, void *opaque ) { struct reiserfs_iget4_args *args; +int retval; args = opaque; +/* We protect against possible parallel init_inode() on another CPU here. */ +spin_lock (&keycopy_lock);/* args is already in CPU order */ -return le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid; +if (le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid) + retval =1 ; +else +/* If The key does not match, lets see if we are racing +with another iget4, that already progressed so far +to reiserfs_read_inode2() and was preempted in +call to search_by_key(). The signs of that are: +Inode is locked +dirid and object id are zero (not yet initialized)*/ + retval = (inode->i_state &I_LOCK ) && + !INODE_PKEY (inode)->k_dir_id && + !INODE_PKEY (inode)->k_objectid; + +spin_unlock (&keycopy_lock); +return retval; } struct inode * reiserfs_iget (struct super_block * s, const struct
cpu_key* key)
Hello!
Quoted 4 lines · John Dalbec
I just got an "nfsd-fh: found a name that I didn't expect" yesterday. I'm using a Red Hat 2.4.20 RPM with 2.4.20-pending+data-logging+quota. Should I apply just this patch or both this patch and the iget5_locked_2.4.20 patch?
You only need the patch below. iget5_locked_2.4.20 patch is broken.
Bye,
Oleg
Quoted 59 lines
Quoted 57 lines
=====
fs/reiserfs/inode.c1.42 vs edited =====fs/reiserfs/inode.c +8
-1@@ -20,6 +20,10 @@static int reiserfs_get_block (struct inode * inode,long block,struct buffer_head * bh_result,int create); +/* This spinlock guards inode pkey in private part of inode +against race between find_actor() vs reiserfs_read_inode2 */ +static spinlock_t keycopy_lock =SPIN_LOCK_UNLOCKED ; +void reiserfs_delete_inode (struct inode * inode) {int jbegin_count =JOURNAL_PER_BALANCE_CNT *2 ;@@ -898,8 +902,9 @@ bh =PATH_PLAST_BUFFER (path); ih =PATH_PITEM_HEAD (path); - +spin_lock (&keycopy_lock);copy_key (INODE_PKEY (inode), &(ih->ih_key)); +spin_unlock (&keycopy_lock); inode->i_blksize =PAGE_SIZE ;INIT_LIST_HEAD (&inode->u.reiserfs_i.i_prealloc_list) ;@@ -1220,10 +1225,27 @@ unsigned long inode_no, void *opaque ) { struct reiserfs_iget4_args *args; +int retval; args = opaque; +/* We protect against possible parallel init_inode() on another CPU here. */
fs/reiserfs/inode.c +16
-1+spin_lock (&keycopy_lock);/* args is already in CPU order */ -return le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid; +if (le32_to_cpu (INODE_PKEY (inode)->k_dir_id) == args -> objectid) + retval =1 ; +else +/* If The key does not match, lets see if we are racing +with another iget4, that already progressed so far +to reiserfs_read_inode2() and was preempted in +call to search_by_key(). The signs of that are: +Inode is locked +dirid and object id are zero (not yet initialized)*/ + retval = (inode->i_state &I_LOCK ) && + !INODE_PKEY (inode)->k_dir_id && + !INODE_PKEY (inode)->k_objectid; + +spin_unlock (&keycopy_lock); +return retval;}
struct inode *
reiserfs_iget(structsuper_block* s, const structcpu_key* key)
Quoted 3 lines
We do not yet understand on how to reproduce that locally, because this message indicates pretty strange conditions.
Oh, I just logged in from home and checked the logfiles and saw that /usr/sbin/logrotate is affected as well. However, this time the clients don't get I/O-errors for this file, its only the server that reports the problems.
Well, if you like, I could provide you a dd-image of this partition, though its rather large (19GB).
Bernd
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Oleg,
i've forgot to CC to reiserfs-list last time, so i do a full quote.
Quoted 16 lines · you
Hello!
Quoted 4 lines · Roland
i've read your thread very interessted, because i think i've a very similar problem (but until know, i didn't think about reiserfs as source): kernel 2.4.20 SMP, HighMem, HighMem IO (without ptrace patch) root filesystem ~70GB ext3 on Compaq CISS
Quoted 8 lines
/data filesystems ~1.1TB reiserfs (on top of lvm) on a second Compaq CISS
System: Compaq Dual PIII 2GB Ram
the system is used as nfs fileserver for diskless clients (about 30 right now) first we experienced high load situations during daily cron jobs, later we saw log messages very similar to what Bernd has (/usr/sbin/logrotate,/usr/lib/perl5/...) and last week we had a crash of the fileserver (no sysreq key's, console blanking didn't responded, ping to system was ok)
Quoted 1 line
Was there anything in logs after reboot?
no, nothing...
Quoted 7 lines
Quoted 3 lines
since that crash we don't have any 'nfsd-fh: found a name that I didn't expect:' messages; but we need to find out what was behind that crash... Any ideas?
If only you had related kernel oops/whatever was caused the crash (either on your HDD, or captured via serial console/network oops dumper/whatever), that would be much easier.
the system has no serial console attached *sight*, the logs on disk carried nothing useful...
Quoted 6 lines
Quoted 3 lines
(it would be possible for me to provide a machine which is 100% identical to our production fileserver if this would help for tests, but i don't have ressources to put up more than one client for this testsystem...)
Since we do not know yet on how to produce those nfsd-fh stuff, there is no point in using your test server yet.
hmm... ok if you think it can be useful, let me know...
Greetings,
Roland