<div dir="ltr"><div><div><div><div><div>&gt;&gt;Can you explain the code paths that are causing an issue with dcache_lock gone?<br></div><div><br></div><div>I would try to explain whatever I can to the best of my ability but if further insight is needed, the code can be reffered at <a href="https://github.com/HeisSpiter/hepunion/">https://github.com/HeisSpiter/hepunion/</a>.<br>
</div><div><br></div><div><br></div>See I am working on a type of Union file System which has two branches -<br></div>1. Read Only- have individual mount point<br></div>2.Read Write-also have individual mount point<br><br>
</div>Now they coexist in a merged mount point.<br>
<br></div>so when such a mount command gets issued in my driver(HEPunion FS)-<div>mount -t Hepunion -o /tmp/rw_path=RW:/tmp/ro_path=RO none /tmp/merged</div><div><br></div><div>Here /tmp/rw-path is the Read Write branch mount point, /tmp/ro_path is the Read Only branch mount point and merged point of the two branches are /tmp/merged</div>
<div><br></div><div>1.In this mount command following three main steps happen for each branch one after the other<br></div><div><br></div><div>Step1-hepunion_read_super which involves</div><div><br></div><div>a)get_branches: </div>
<div>            MNT_POINT1=RW</div><div>            MNT_POINT2=RO </div><div><br></div><div>b)make_path: RW, make_path:<span class="" style="white-space:pre">        </span>RO</div><div><br></div><div>Step2-hepunion_permission which involves</div>
<div><br></div><div> a) get_relative_path:  </div><div>       </div><div> b) get_file_attr:</div><div><br></div><div><br></div><div>Step3- hepunion_getattr which involves</div><div>       </div><div>a) get_relative_path:       </div>
<div><br></div><div> b) get_file_attr:      </div><div><br><div>So my mount is successful</div><div><br></div><div>2. But when I navigate to mount point and do a &quot;ls&quot; ....THE KERNEL CRASHES</div><div>The last few messages I collect from crash utility is the call to hepunion_permission  which again involves the above two steps-</div>
<div><br></div><div><div>a) get_relative_path:-----<b>This is where my kernel crashes  </b></div><div>       </div><div>b) get_file_attr:- I do not reach here</div></div><div><br></div><div><br></div><div><b>Now what I fail to understand that when a previous call to &quot;hepunion_permission&quot; was successful in &quot;mount&quot; command why it now fails at &quot;ls&quot; . </b></div>
<div><br></div><div class="gmail_extra">P.S.- All the above discussed calls are based on the dmesg and the syslogs and may not be properly visualized by just looking at the driver code. If the the entire kernel log is needed for various steps, I can also provide that.<br>
<br><div class="gmail_quote">On Tue, Sep 3, 2013 at 3:40 AM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><br>
&gt; Since lot of things have changed from 2.6.18 to 3.8 and I have taken a lot<br>
&gt; of care to replace the old kernel APIs with the newer ones but then too<br>
&gt; there have been certain things I haven&#39;t been able to replace and<br>
&gt; dcache_lock is one of them.<br>
&gt;<br>
&gt; Due to the absence of dcache_lock, I have not been able to properly lock<br>
&gt; stuff and writing/reading data that are being changed that maybe one of the<br>
&gt; reasons for instability.<br>
<br>
</div>There&#39;s nothing stopping your driver from adding its own locking to<br>
protect itself from itself.  If the problem is that you used to use<br>
dcache_lock to protect your critical variables from other parts of the<br>
kernel, you&#39;ll need to restructure your code to avoid the issue, or find<br>
other suitable locking.<br>
<br>
Can you explain the code paths that are causing an issue with dcache_lock gone?<br>
</blockquote></div><br></div></div></div>