bugThe GNU Hurd - Bugs: bug #30256, device_close not automatically...


bug #30256: device_close not automatically closed on port closure

Submitted by:  None
Submitted on:  Thu 24 Jun 2010 10:03:31 PM UTC  
Category:  GNU Mach Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Originator Email:  -email is unavailable- Open/Closed:  Open
Reproducibility:  Every Time Size (loc):  None
Planned Release:  None Effort:  0.00
Wiki-like text discussion box: 

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 30 Jun 2010 02:20:34 AM UTC, comment #2: 

I'd have thought that no_senders would be called when the port is
really closed, but for some reason that doesn't happen. portinfo claims
only my test process has a reference to the port. The kernel source
code seems to make sure that the kernel only has a receive reference to
the port.

Samuel Thibault <sthibaul>
Project Administrator
Wed 30 Jun 2010 01:48:58 AM UTC, comment #1: 

Mmm, reading it looks as if they're not supposed to be coupled.

Reopening a device twice returns the same port, with an additional
reference on it.  As of now, closing the port does not close the
device, and if you reopen the device, you get again the same port, on
which you can call close_device() twice: once for the re-open, and once
for the previous open.

The issue at stake is for instance swapon: it store_open("/dev/hd2"),
which opens /dev/hd2, then call file_get_storage_info(), which gets the
device port. swapon then uses store_remap, which closes the port to
/dev/hd2 (but keeps the device port). This assumes that no device_close
has been done (i.e. the device_open responsibility done by storeio is
somehow transferred to swapon...). But what if nobody remembers to
close_device? (which is the case atm)

Samuel Thibault <sthibaul>
Project Administrator
Thu 24 Jun 2010 10:03:31 PM UTC, original submission:  

if a process uses device_open() but not device_close before exiting, the mach device will remain open.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by sthibaul (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.6