Fixed bug introduced by calling do_open() for O_RDONLY files. Changed it