RFR: 8229872: (fs) Increase buffer size used with getmntent

Vladimir Kempik vkempik at azul.com
Tue Aug 20 19:31:01 UTC 2019


Hello

after reading manpage for getline I think I have found some elegant solution - to let getline manage size of buffer.

Please review v2 of patch here http://cr.openjdk.java.net/~vkempik/8229872/webrev.02/

I’m still worried about syncing maxlinelen and linebuffer between Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0 and Java_sun_nio_fs_LinuxNativeDispatcher_getmntent, if they are run from different threads.

Thanks, Vladimir

> 20 авг. 2019 г., в 17:38, Florian Weimer <fweimer at redhat.com> написал(а):
> 
> * Vladimir Kempik:
> 
>> I’m planning to sync setmntent/getmntent on some object via MonitorEnter/Exit to prevent race condition.
>> But where to get some jobject ?
>> Should I pass it from caller (java method), but then It needs to be some static object.
>> Or should I create my own on first usage of setmntent ?
> 
> The new race condition is with other processes (not even Java processes)
> which do mounts.  There is no way to avoid it reliably.
> 
> I still recommend to implement the file parsing in Java.  It's more code
> than what's there today only because all of it would currently be
> Linux-specific.  Otherwise I expect to be it a simplification.
> 
> Thanks,
> Florian



More information about the nio-dev mailing list