Ticket #3825 (new defect)

Opened 6 months ago

Last modified 6 months ago

Do not keep the directory handle open

Reported by: birdie Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc: egmont
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

When you enter any directory using MC, the device which directory belongs to, becomes "busy" and you cannot unmount it any longer.

Please fix it.

Change History

comment:1 Changed 6 months ago by andrew_b

  • Milestone changed from 4.8.20 to Future Releases

Apparently not a bug.

comment:2 Changed 6 months ago by egmont

  • Cc egmont added

mc along with its subshell change their working directory, just as e.g. your shell does when you cd there.

I agree with andrew_b, there's no bug here, this is the desired behavior. Switch away from that directory in order to unmount the device.

comment:3 follow-up: ↓ 4 Changed 6 months ago by birdie

We may argue whether this is a bug or not, but clearly it's not an intended behaviour as it complicates the lives of MC users.

Also, until the user actually ran some command in MC, I don't understand why MC needs to spawn a shell. Please explain why the shell is needed.

comment:4 in reply to: ↑ 3 Changed 6 months ago by egmont

Replying to birdie:

We may argue whether this is a bug or not, but clearly it's not an intended behaviour as it complicates the lives of MC users.

mc is not special here, I believe pretty much any other application (e.g. other terminal based or graphical file managers) would cause you this problem.

I know the frustration it causes, but the frustration would remain even if we changed mc's behavior. You'd still have to potentially find lots of other apps (including the shell from which you started mc) and terminate them.

This situation cries for a generic OS-wide solution, which could either be a standalone app showing all the apps that hold a file descriptor to a given mount point and offering to kill them, or to be able to force the unmount of a device and send input/output errors to apps that still hold a reference.

I don't think it's feasible for mc to work around a drawback of the generic Unix design.

Also, until the user actually ran some command in MC, I don't understand why MC needs to spawn a shell. Please explain why the shell is needed.

The shell is not needed, you can launch mc -u that goes without the subshell. The current unmount problem remains with mc itself, though. Plus, you'll get limited usability. Those limitations that you'll see (e.g. lack of the usual prompt, to begin with) are the exact reasons a subshell is nice to have.

Note: See TracTickets for help on using tickets.