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

Brian Burkhalter brian.burkhalter at oracle.com
Tue Aug 20 20:16:41 UTC 2019


Hello,

> On Aug 20, 2019, at 12:46 PM, Vladimir Kempik <vkempik at azul.com> wrote:
> 
> about L236, I really think I should not
> 
> linebuffer will live throughtout app lifetime and will be realloced only when needed.  It’s kind of cache now, for use by getmntent_r.
> if I free linebuffer and set it to NULL, then I will have to set maxlinelen to 0 as well, otherwise getline will fail.
> This means the app will have to recalc maxline ( and do some reallocs to linebuffer) every time setmntent0 is called.
> 
> So I believe it’s better to let linebuffer leave, it’s not memory leak as we are tracking it and using it still.

OK

>>> On Aug 20, 2019, at 12:31 PM, Vladimir Kempik <vkempik at azul.com <mailto:vkempik at azul.com>> wrote:
>>> 
>>> 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/ <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.

Yes, I also wonder whether a synchronized(this) block or some such in LinuxFileSystem.getMountEntries(String) might be in order.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190820/7f70ca0e/attachment.html>


More information about the nio-dev mailing list