The VFS knows which user/process has sent read/write request. Is the actual block device aware of these details.

Does 'bio' struct contain any details which point to the user space parameters? Using current_uid(), etc, give the UID as 0 which actually corresponds to kjournald which performs the read/write


No, the block device doesn't know what process or user caused a disk access. The fundamental reason why it doesn't know is that this concept is not well-defined. There is no direct relationship between a disk access and a file access. For example, if multiple processes read from the same location in the same file at practically the same time, then they may both have a pending read request which trickles down to the hardware. Another example is that a buffered write could take place after the process whose activity caused the write has died.

| improve this answer | |
  • Still btrace (wrapper for blktrace) on Linux can tell you what process triggered a block device I/O operation (at least for some of them) – Stéphane Chazelas Sep 7 '17 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.