<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">While doing some other work, I noticed something I believe is a potential problem in the server side quota code.
<div><br>
</div>
<div>Specifically, in qmt_glimpse_lock:</div>
<div><br>
</div>
<div>While the resource lock (a spin lock) is held, it does</div>
<div><br>
</div>
<div>OBD_ALLOC_PTR(work);<br>
<br>
</div>
<div>Since allocations can sleep, doesn't this allocation need to be atomic?</div>
<div><br>
</div>
<div>So, following the current Lustre convention, it should be:</div>
<div><span style="font-family: monospace; font-size: 16px;">LIBCFS_ALLOC_ATOMIC(work, sizeof(struct</span></div>
<div><span style="font-family: monospace; font-size: 16px;">ldlm_glimpse_work));</span></div>
<div><span style="font-family: monospace; font-size: 16px;"><br>
</span></div>
<div>
<div style="font-size: 13.3333330154419px;">I have seen no actual bugs from this, but I hit a hang while modifying the equivalent code in ofd_intent_policy for lock ahead, and I think the same hang is theoretically possible here.  My understanding is that,
 in general, doing allocations while holding a spin lock is not recommended.</div>
</div>
<div style="font-size: 13.3333330154419px;"><br>
</div>
<div style="font-size: 13.3333330154419px;">I'm hoping for other input before I go further - Am I right that this is something which needs fixing?  If so, I'll open an LU and submit a patch.</div>
<div style="font-size: 13.3333330154419px;"><br>
</div>
<div style="font-size: 13.3333330154419px;">Thanks,</div>
<div style="font-size: 13.3333330154419px;">- Patrick</div>
</div>
</body>
</html>