On Fri, 18 Apr 2014 13:38:58 +0800 Sonu a <p10sonu@xxxxxxxxx> wrote: > when disk is removed with out mdadm as I see from the stack below the > communication reaching the md driver. > > dump_stack+0x49/0x5e > md_error+0x50/0x110 [md_mod] > state_store+0x43/0x300 [md_mod] > rdev_attr_store+0xad/0xd0 [md_mod] > ? sysfs_write_file+0x62/0x1c0 > sysfs_write_file+0x138/0x1c0 > vfs_write+0xc0/0x1e0 > SyS_write+0x5a/0xa0 > ? __audit_syscall_exit+0x246/0x2f0 > system_call_fastpath+0x16/0x1b > > could someone point me to the code which is monitoring scsi disks > status and thus calling md driver sysfs interface accordingly ? I think you ask asking how md_error gets called when a SCSI device fails, having already discovered how it is called when you explicitly write to a sysfs file. Nothing monitors the scsi disks. md only discovers failure if it sends a request to a disk, and the request signals an error. If you search for 'bi_end_io', functions assigned to this field are called when a request finishes. Those functions might call md_error if the request failed, or they might schedule some other handling first to try to correct the error. NeilBrown
Attachment:
signature.asc
Description: PGP signature