Skip to contentSkip to conversation

vfs: add MNT_NOFOLLOW flag to umount(2)

RFC PATCH Bodo Eggert 3 participants 3 messages Feb 4, 2010 – Feb 8, 2010 1 message not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Miklos Szeredi

Additionally, return -EINVAL if an unknown flag is encountered. This makes it possible for the caller to determine if a flag is supported or not (at least on kernels with this patch).

There should be a guaranteed-to-be-invalid flag or flag-combination in order to safely detect this feature.

#2 lore raw
Quoted 8 lines · Bodo Eggert
Quoted 3 lines · Miklos Szeredi

Additionally, return -EINVAL if an unknown flag is encountered. This makes it possible for the caller to determine if a flag is supported or not (at least on kernels with this patch).

There should be a guaranteed-to-be-invalid flag or flag-combination in order to safely detect this feature.

It's difficult though, because the app would have to make sure the detection itself would reliably fail, and with a different error.

Simply checking the kernel version might be easier.

Thanks,
Miklos

#3 lore raw
Quoted 7 lines · Miklos Szeredi
Quoted 6 lines · Bodo Eggert
Quoted 3 lines · Miklos Szeredi

Additionally, return -EINVAL if an unknown flag is encountered. This makes it possible for the caller to determine if a flag is supported or not (at least on kernels with this patch).

Quoted 7 lines
Quoted 2 lines

There should be a guaranteed-to-be-invalid flag or flag-combination in order to safely detect this feature.

It's difficult though, because the app would have to make sure the detection itself would reliably fail, and with a different error.

Simply checking the kernel version might be easier.

Yes, that's exactly what I intend to make possible:

| ret = umount("/tmp/mkstmp", UMOUNT_IMPOSSIBLE_FLAG);
| if (ret != -1 || errno != -EINVAL)
|     goto extended_mount_flags_are_not_supported;

Checking the kernel version is a bad idea, because the application might be portable, or features might be backported. ¢¢