id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
2541	mc quits with excessive audible I/O loads	cosoleto	andrew_b	"Hello,

Since commit a931ff73ccecbe5c0938b110e56f62570146409a

Author: Slava Zanko <slavazanko@gmail.com>
Date:   Mon Oct 5 13:15:30 2009 +0300

    Ticket #1617: ownership of files ~/.mc

that changes how mc saves config files, when you quit mc or mcedit you can get noise due to seeking at least on systems with non-silent disk drive (I own a WD Raptor). In spite of config files size. I think this is a bug, as well as a regression.

I got the time to see that the function mc_config_new_or_override_file() is called more times with the same filename and removing O_SYNC in mc_open() mades the operation silent to me. Maybe there isn't a good combination of things.

From mc_config_new_or_override_file():
    fd = mc_open (ini_path, O_WRONLY | O_TRUNC | O_SYNC, 0);
[...]
    for (written_data = data, total_written = len;
         (cur_written = mc_write (fd, (const void *) written_data, total_written)) > 0;
         written_data += cur_written, total_written -= cur_written) {

open sequence while mc quits:
open(""/home/fra/.mc/ini"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/ini"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/ini"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/panels.ini"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/ini"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/history"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/history"", O_WRONLY|O_TRUNC|O_SYNC) = 9
open(""/home/fra/.mc/history"", O_WRONLY|O_TRUNC|O_SYNC) = 9
"	defect	closed	major	4.8.0-pre1	mc-core	4.7.5	fixed					merged	committed-master committed-stable
