[PATCH] umount: always use umount2 syscall with specified flags

Xabier Oneca -- xOneca xoneca at gmail.com
Wed Oct 21 21:33:53 UTC 2015


2015-10-19 4:00 GMT+02:00 Denys Vlasenko <vda.linux at googlemail.com>:
> On Sat, Oct 17, 2015 at 1:12 PM, Xabier Oneca  --  xOneca
> <xoneca at gmail.com> wrote:
>> 2015-10-13 17:02 GMT+02:00 Denys Vlasenko <vda.linux at googlemail.com>:
>>> On Tue, Oct 13, 2015 at 3:09 PM, Jody Bruchon <jody at jodybruchon.com> wrote:
>>>> This makes it sound like the whole OPT_FORCE/OPT_LAZY thing is unnecessary:
>>>> // MNT_FORCE and MNT_DETACH (from linux/fs.h) must match
>>>> // OPT_FORCE and OPT_LAZY.
>>>
>>> It is obvious you did not bother reading the code before coming up
>>> with criticism.
>>>
>>> If you would actually go and look at busybox/util-linux/umount.c,
>>> you would realize that OPT_FORCE and OPT_LAZY values
>>> are not arbitrary. Just declaring them equal to MNT_FORCE/MNT_DETACH,
>>> without regard to their numeric values, is not possible.
>>
>> They have the same value so we can do this and be happy:
>>
>>     doForce = opt & (OPT_FORCE|OPT_LAZY);
>>
>> That's the only reason they have to match. (doForce is passed to umount.)
>>
>> It's a clever way, let's hope MNT_FORCE and MNT_LAZY never change
>> their value... ;)
>
> They won't. Linus has a policy of not breaking kernel's ABI unless
> there are some VERY strong reasons to do so.

That's why I have ended my answer with ;) instead of with :( or with :S

Cheers, :P

Xabier Oneca_,,_


More information about the busybox mailing list