Re: [BUG] 2.6.24-rc3-mm2 kernel bug on nfs cifs mounted partitions

2007-11-29 Thread Kamalesh Babulal
Andrew Morton wrote:
 On Thu, 29 Nov 2007 14:30:14 +0530 Kamalesh Babulal [EMAIL PROTECTED] wrote:
 
 Hi Andrew,

 While running file system stress on nfs and cifs mounted partitions, the 
 machine
 drops to xmon

 1:mon e
 cpu 0x1: Vector: 300 (Data Access) at [c00080a9f880]
 pc: c01392c8: .inotify_inode_queue_event+0x50/0x158
 lr: c01074d0: .vfs_link+0x204/0x298
 sp: c00080a9fb00
msr: 80009032
dar: 280 
  dsisr: 4001
   current = 0xc000c8e6f670
   paca= 0xc0512c00
 pid   = 2848, comm = fsstress
 1:mon t
 [c00080a9fbd0] c01074d0 .vfs_link+0x204/0x298
 [c00080a9fc70] c010b6e0 .sys_linkat+0x134/0x1b4
 [c00080a9fe30] c000872c syscall_exit+0x0/0x40
 --- Exception: c00 (System Call) at 0ff1bdfc
 SP (ffeaed10) is in userspace
 1:mon r
 R00 = c01074d0   R16 = 
 R01 = c00080a9fb00   R17 = 
 R02 = c060c380   R18 = 
 R03 =    R19 = 
 R04 = 0004   R20 = 
 R05 =    R21 = 
 R06 =    R22 = 
 R07 =    R23 = 0004
 R08 =    R24 = 0280
 R09 =    R25 = f000
 R10 = 0001   R26 = c00082827790
 R11 = c03963e8   R27 = c000828275a0
 R12 = d0deec78   R28 = 
 R13 = c0512c00   R29 = c0007b18fcf0
 R14 =    R30 = c05bc088
 R15 =    R31 = 
 pc  = c01392c8 .inotify_inode_queue_event+0x50/0x158
 lr  = c01074d0 .vfs_link+0x204/0x298
 msr = 80009032   cr  = 24000882
 ctr = c03963e8   xer =    trap =  300 
 dar = 0280   dsisr = 4001


 The gdb output shows 

 0xc01076d4 is in vfs_symlink (include/linux/fsnotify.h:108).
 103  * fsnotify_create - 'name' was linked in
 104  */  
 105 static inline void fsnotify_create(struct inode *inode, struct 
 dentry *dentry)
 106 {   
 107 inode_dir_notify(inode, DN_CREATE);
 108 inotify_inode_queue_event(inode, IN_CREATE, 0, 
 dentry-d_name.name,
 109   dentry-d_inode);
 110 audit_inode_child(dentry-d_name.name, dentry, inode);
 111 }   
 112

 
 If it is reproducible can you please try reverting
 inotify-send-in_attrib-events-when-link-count-changes.patch?

Hi Andrew,

reverting the patch 
inotify-send-in_attrib-events-when-link-count-changes.patch, the 
bug is not reproduced.

-- 
Thanks  Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [BUG] 2.6.24-rc3-mm2 kernel bug on nfs cifs mounted partitions

2007-11-29 Thread Kamalesh Babulal
Jan Kara wrote:
 On Thu 29-11-07 17:27:08, Kamalesh Babulal wrote:
 Andrew Morton wrote:
 On Thu, 29 Nov 2007 14:30:14 +0530 Kamalesh Babulal [EMAIL PROTECTED] 
 wrote:

 Hi Andrew,

 While running file system stress on nfs and cifs mounted partitions, the 
 machine
 drops to xmon

 1:mon e
 cpu 0x1: Vector: 300 (Data Access) at [c00080a9f880]
 pc: c01392c8: .inotify_inode_queue_event+0x50/0x158
 lr: c01074d0: .vfs_link+0x204/0x298
 sp: c00080a9fb00
msr: 80009032
dar: 280 
  dsisr: 4001
   current = 0xc000c8e6f670
   paca= 0xc0512c00
 pid   = 2848, comm = fsstress
 1:mon t
 [c00080a9fbd0] c01074d0 .vfs_link+0x204/0x298
 [c00080a9fc70] c010b6e0 .sys_linkat+0x134/0x1b4
 [c00080a9fe30] c000872c syscall_exit+0x0/0x40
 --- Exception: c00 (System Call) at 0ff1bdfc
 SP (ffeaed10) is in userspace
 1:mon r
 R00 = c01074d0   R16 = 
 R01 = c00080a9fb00   R17 = 
 R02 = c060c380   R18 = 
 R03 =    R19 = 
 R04 = 0004   R20 = 
 R05 =    R21 = 
 R06 =    R22 = 
 R07 =    R23 = 0004
 R08 =    R24 = 0280
 R09 =    R25 = f000
 R10 = 0001   R26 = c00082827790
 R11 = c03963e8   R27 = c000828275a0
 R12 = d0deec78   R28 = 
 R13 = c0512c00   R29 = c0007b18fcf0
 R14 =    R30 = c05bc088
 R15 =    R31 = 
 pc  = c01392c8 .inotify_inode_queue_event+0x50/0x158
 lr  = c01074d0 .vfs_link+0x204/0x298
 msr = 80009032   cr  = 24000882
 ctr = c03963e8   xer =    trap =  300 
 dar = 0280   dsisr = 4001


 The gdb output shows 

 0xc01076d4 is in vfs_symlink (include/linux/fsnotify.h:108).
 103  * fsnotify_create - 'name' was linked in
 104  */  
 105 static inline void fsnotify_create(struct inode *inode, struct 
 dentry *dentry)
 106 {   
 107 inode_dir_notify(inode, DN_CREATE);
 108 inotify_inode_queue_event(inode, IN_CREATE, 0, 
 dentry-d_name.name,
 109   dentry-d_inode);
 110 audit_inode_child(dentry-d_name.name, dentry, inode);
 111 }   
 112

 If it is reproducible can you please try reverting
 inotify-send-in_attrib-events-when-link-count-changes.patch?
 Hi Andrew,

 reverting the patch 
 inotify-send-in_attrib-events-when-link-count-changes.patch, the 
 bug is not reproduced.
   OK, thanks for testing. I was trying to reproduce the problem locally but
 without success so far - I guess it's either NFS or CIFS which makes the
 problem appear. I'll investigate more.
 
   Honza

Hi Jan,

I was running file system stress parallely on NFS and CIFS mounted partitions.
  

-- 
Thanks  Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [BUG] 2.6.24-rc3-mm2 kernel bug on nfs cifs mounted partitions

2007-11-29 Thread Jan Kara
On Thu 29-11-07 17:27:08, Kamalesh Babulal wrote:
 Andrew Morton wrote:
  On Thu, 29 Nov 2007 14:30:14 +0530 Kamalesh Babulal [EMAIL PROTECTED] 
  wrote:
  
  Hi Andrew,
 
  While running file system stress on nfs and cifs mounted partitions, the 
  machine
  drops to xmon
 
  1:mon e
  cpu 0x1: Vector: 300 (Data Access) at [c00080a9f880]
  pc: c01392c8: .inotify_inode_queue_event+0x50/0x158
  lr: c01074d0: .vfs_link+0x204/0x298
  sp: c00080a9fb00
 msr: 80009032
 dar: 280 
   dsisr: 4001
current = 0xc000c8e6f670
paca= 0xc0512c00
  pid   = 2848, comm = fsstress
  1:mon t
  [c00080a9fbd0] c01074d0 .vfs_link+0x204/0x298
  [c00080a9fc70] c010b6e0 .sys_linkat+0x134/0x1b4
  [c00080a9fe30] c000872c syscall_exit+0x0/0x40
  --- Exception: c00 (System Call) at 0ff1bdfc
  SP (ffeaed10) is in userspace
  1:mon r
  R00 = c01074d0   R16 = 
  R01 = c00080a9fb00   R17 = 
  R02 = c060c380   R18 = 
  R03 =    R19 = 
  R04 = 0004   R20 = 
  R05 =    R21 = 
  R06 =    R22 = 
  R07 =    R23 = 0004
  R08 =    R24 = 0280
  R09 =    R25 = f000
  R10 = 0001   R26 = c00082827790
  R11 = c03963e8   R27 = c000828275a0
  R12 = d0deec78   R28 = 
  R13 = c0512c00   R29 = c0007b18fcf0
  R14 =    R30 = c05bc088
  R15 =    R31 = 
  pc  = c01392c8 .inotify_inode_queue_event+0x50/0x158
  lr  = c01074d0 .vfs_link+0x204/0x298
  msr = 80009032   cr  = 24000882
  ctr = c03963e8   xer =    trap =  300 
  dar = 0280   dsisr = 4001
 
 
  The gdb output shows 
 
  0xc01076d4 is in vfs_symlink (include/linux/fsnotify.h:108).
  103  * fsnotify_create - 'name' was linked in
  104  */  
  105 static inline void fsnotify_create(struct inode *inode, struct 
  dentry *dentry)
  106 {   
  107 inode_dir_notify(inode, DN_CREATE);
  108 inotify_inode_queue_event(inode, IN_CREATE, 0, 
  dentry-d_name.name,
  109   dentry-d_inode);
  110 audit_inode_child(dentry-d_name.name, dentry, inode);
  111 }   
  112
 
  
  If it is reproducible can you please try reverting
  inotify-send-in_attrib-events-when-link-count-changes.patch?
 
 Hi Andrew,
 
 reverting the patch 
 inotify-send-in_attrib-events-when-link-count-changes.patch, the 
 bug is not reproduced.
  OK, thanks for testing. I was trying to reproduce the problem locally but
without success so far - I guess it's either NFS or CIFS which makes the
problem appear. I'll investigate more.

Honza
-- 
Jan Kara [EMAIL PROTECTED]
SUSE Labs, CR
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [BUG] 2.6.24-rc3-mm2 kernel bug on nfs cifs mounted partitions

2007-11-29 Thread Jan Kara
On Thu 29-11-07 17:27:08, Kamalesh Babulal wrote:
 Andrew Morton wrote:
  On Thu, 29 Nov 2007 14:30:14 +0530 Kamalesh Babulal [EMAIL PROTECTED] 
  wrote:
  
  Hi Andrew,
 
  While running file system stress on nfs and cifs mounted partitions, the 
  machine
  drops to xmon
 
  1:mon e
  cpu 0x1: Vector: 300 (Data Access) at [c00080a9f880]
  pc: c01392c8: .inotify_inode_queue_event+0x50/0x158
  lr: c01074d0: .vfs_link+0x204/0x298
  sp: c00080a9fb00
 msr: 80009032
 dar: 280 
   dsisr: 4001
current = 0xc000c8e6f670
paca= 0xc0512c00
  pid   = 2848, comm = fsstress
  1:mon t
  [c00080a9fbd0] c01074d0 .vfs_link+0x204/0x298
  [c00080a9fc70] c010b6e0 .sys_linkat+0x134/0x1b4
  [c00080a9fe30] c000872c syscall_exit+0x0/0x40
  --- Exception: c00 (System Call) at 0ff1bdfc
  SP (ffeaed10) is in userspace
  1:mon r
  R00 = c01074d0   R16 = 
  R01 = c00080a9fb00   R17 = 
  R02 = c060c380   R18 = 
  R03 =    R19 = 
  R04 = 0004   R20 = 
  R05 =    R21 = 
  R06 =    R22 = 
  R07 =    R23 = 0004
  R08 =    R24 = 0280
  R09 =    R25 = f000
  R10 = 0001   R26 = c00082827790
  R11 = c03963e8   R27 = c000828275a0
  R12 = d0deec78   R28 = 
  R13 = c0512c00   R29 = c0007b18fcf0
  R14 =    R30 = c05bc088
  R15 =    R31 = 
  pc  = c01392c8 .inotify_inode_queue_event+0x50/0x158
  lr  = c01074d0 .vfs_link+0x204/0x298
  msr = 80009032   cr  = 24000882
  ctr = c03963e8   xer =    trap =  300 
  dar = 0280   dsisr = 4001
 
 
  The gdb output shows 
 
  0xc01076d4 is in vfs_symlink (include/linux/fsnotify.h:108).
  103  * fsnotify_create - 'name' was linked in
  104  */  
  105 static inline void fsnotify_create(struct inode *inode, struct 
  dentry *dentry)
  106 {   
  107 inode_dir_notify(inode, DN_CREATE);
  108 inotify_inode_queue_event(inode, IN_CREATE, 0, 
  dentry-d_name.name,
  109   dentry-d_inode);
  110 audit_inode_child(dentry-d_name.name, dentry, inode);
  111 }   
  112
 
  
  If it is reproducible can you please try reverting
  inotify-send-in_attrib-events-when-link-count-changes.patch?
 
 Hi Andrew,
 
 reverting the patch 
 inotify-send-in_attrib-events-when-link-count-changes.patch, the 
 bug is not reproduced.
  OK, it's a problem with CIFS. Its cifs_hardlink() function doesn't call
d_instantiate() and thus returns a dentry with d_inode set to NULL. I'm not
sure if such behavior is really correct but anyway, attached is a new
version of the patch which should handle it gracefully. Kamalesh, can you
please give it a try? Thanks.

Honza
-- 
Jan Kara [EMAIL PROTECTED]
SUSE Labs, CR
---

  Currently, no notification event has been sent when inode's link count
changed. This is inconvenient for the application in some cases:
  Suppose you have the following directory structure
foo/test
bar/

  and you watch test. If someone does mv foo/test bar/, you get event
IN_MOVE_SELF and you know something has happened with the file test.
However if someone does ln foo/test bar/test and rm foo/test you get no
inotify event for the file test (only directories foo and bar receive
events).
  Furthermore it could be argued that link count belongs to file's metadata
and thus IN_ATTRIB should be sent when it changes.
  The following patch implements sending of IN_ATTRIB inotify events when
link count of the inode changes, i.e., when a hardlink to the inode is
created or when it is removed. This event is sent in addition to all the
events sent so far. In particular, when a last link to a file is removed,
IN_ATTRIB event is sent in addition to IN_DELETE_SELF event.

Signed-off-by: Jan Kara [EMAIL PROTECTED]

diff --git a/fs/namei.c b/fs/namei.c
index 3b993db..c1839d1 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2188,6 +2188,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
 
/* We don't d_delete() NFS sillyrenamed files--they still exist. */
if (!error  !(dentry-d_flags  DCACHE_NFSFS_RENAMED)) {
+   fsnotify_link_count(dentry-d_inode);
d_delete(dentry);
}
 
@@ -2360,7 +2361,7 @@ int vfs_link(struct dentry *old_dentry, struct inode 
*dir, struct dentry *new_de
error = dir-i_op-link(old_dentry, dir, new_dentry);
mutex_unlock(old_dentry-d_inode-i_mutex);
if (!error)
-   fsnotify_create(dir,