The options -l (lazy) and -f (force) means that the mountpoint may be
unreadable (for example because NFS server is unreadable). So we
should not try to be smart in this case and we should try to minimize
number of situations when stat() or readlink() is used for the
mountpoint.
Signed-off-by: Karel Zak <kzak@redhat.com>
* where LABEL, UUID or symlinks are to canonicalized. It means that
* it's usable only for canonicalized stuff (e.g. kernel mountinfo).
*/
- if (!cxt->mtab_writable && *tgt == '/') {
+ if (!cxt->mtab_writable && *tgt == '/' &&
+ !mnt_context_is_force(cxt) && !mnt_context_is_lazy(cxt)) {
+
struct stat st;
if (stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)) {