On Aug 20, 2009, at 9:53 PM, Tom Haynes wrote:

> Robert Gordon wrote:
>> Hi Tom;
>>
>> I adjusted your loop a little :)
>>
>> Did you intend to retry domount() if retval was not EBUSY or 0 ??
>>
>
> Not intentionally .. :->
>
> It shouldn't hurt.
>
> But anyway,
>
> http://cr.opensolaris.org/~tdh/6636260.rbg/
>
> is my changes based on your review. I pulled the break up
> to make the stuff in the EBUSY case easier to read...

:-) I made it even easier to read (well, on planet robert ;) )

1260         /*
1261          * If we get EBUSY, we retry once to see if we can perform
1262          * the mount. We do this because of a spurious race  
condition.
1263          */
1264         for (i = 0; i < 2; i++) {
1265                 int     error;
1266                 bool_t  was_mounted;
1267
1268                 retval = domount(NULL, uap, stubvp, cr, vfsp);
1269                 if (retval == 0) {
1270                         retval = VFS_ROOT(*vfsp, newvpp);
1271                         VFS_RELE(*vfsp);
1272                         break;
1273                 }
....                 if (retval != EBUSY) {
1274                         break;
1275                 }
1276
1277                 /*
1278                  * Before we try it again, why don't we check
1279                  * to see if it is mounted!
1280                  */
1281                 error = nfs4_trigger_mounted_already(stubvp,
1282                     newvpp, &was_mounted, vfsp);
....
1283                 if (error) {
***
*** retval is still EBUSY
***
1285                        break;
1286                 }
....                 if (was_mounted) {
1287                         retval = 0;
1288                         break;
1289                 }
1290
1291                 /*
1292                  * No error and not mounted, which means we allow  
for a
....                  * retry if the counter allows.
1294                  */
**
** retval remains set to EBUSY, or gets set to a new value from domount 
() if we retry.
**
1296         }
1297
1298 done:

Just nits..
Robert. 

Reply via email to