Hi All

Device : Embedded device with SD card
Kernel : 2.6.14
Problem : while copying data take SD card out , put it back ,the
system crashes


udev is used for destruction and creation of device nodes and each
time it inserted it gets new inode number.

Driver accepts read/write to/from SD card from request queues . When
card is taken out it freezes the request queue from interrupt
handler.User process waits in blocking mode (process like cp,mv into
card) till the queue gets active. when the card is put back it
reactivates the request queue.

But due to changed inode number of device(from using udev) the waiting
userprocess continue to write to same inode old number and hence leads
to crashing the system.

I dont know how to solve this problem. I wanted to kill the process by
using kill command in some scripts which gets executed from udev
scripts, but processes like cp,mv waits in uninterruptible mode ,
which ignores all the signals.

So how to terminate such processes from kernel? I tried to use
send_sig() from kernel , which tries to kill process once it gets come
out of uninterruptible mode to get new data from userprocess.

But problem is how to know which process is writing into the block

I tried to dig into request structre ,but it doesnt store any
information about who has written the data .

I also understands that , sometimes the process which has written data
might not have exists}

Thanks for any help