<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Thank you Valids. That worked!<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">For others who may look for this info:<br></div><div class="gmail_default" style="font-family:monospace,monospace">If you have access to the struct file *<br></div><div class="gmail_default" style="font-family:monospace,monospace">then you could obtain this info with the following<br>condition check:<br><br>============================================<br></div><div class="gmail_default" style="font-family:monospace,monospace">struct file *filp = <blah blah>;<br></div><div class="gmail_default" style="font-family:monospace,monospace">if (filp->f_path.mnt->mnt_flags & MNT_NODEV)<br></div><div class="gmail_default" style="font-family:monospace,monospace"> pr_info("ramfs node\n");<br></div><div class="gmail_default" style="font-family:monospace,monospace">else<br></div><div class="gmail_default" style="font-family:monospace,monospace"> pr_info("persist storage backed node\n");<br>============================================<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 20, 2016 at 7:49 PM, <span dir="ltr"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 20 Jul 2016 18:46:47 -0700, Manoj Rao said:<br>
<br>
> However, I need to run this for each and every read system call which<br>
> includes all the procfs, sysfs and other RAM fs based file reads. My<br>
> code is causing the kernel to panic at some point due to an illegal<br>
> memory access while trying to obtain the starting sector/block for the<br>
> file that's currently being read. My hunch is the crash occurs when<br>
> file being read is on a non-persistent fs such as a sysfs node<br>
> I have gotten hold of the inode structure and I'm trying to find if<br>
> a given inode is stored persistently or not and I've been unable to<br>
> find this information so far.<br>
<br>
</span>Hint: First, check if the filesystem is a pseudo filesystem before bothering<br>
to look for baking store. If you need to know how to do that, steal the<br>
code from the code that prints /proc/filesystems - if it says 'nodev', you'll<br>
only find pain looking for backing storage.<br>
</blockquote></div><br></div>