[PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

Pavel Shilovsky piastry at etersoft.ru
Thu Feb 7 10:50:16 CST 2013

2013/2/7 J. Bruce Fields <bfields at fieldses.org>:
> That would be a bug, I think.  E.g. "man 3posix open":
>         No  files  shall  be created or modified if the function returns
>         -1.
> Looking at the code...  See the references to FILE_CREATED in
> atomic_open--looks like that's trying to prevent may_open from failing
> in this case.
>> I think
>> there is no difference between this case and the situation with
>> deny_lock_file there.
> Looks to me like it would be a bug in either case.

Then we returned from lookup_open in do_last we go to 'opened' lable.
Then we have a 3(!) chances to return -1 while a file is created
(open_check_o_direct, ima_file_check, handle_truncate). In this case
these places are bugs too.

We can call vfs_unlink if we failed after a file was created, but
possible affects need to be investigated.

Best regards,
Pavel Shilovsky.

More information about the wine-devel mailing list