Index: uspace/lib/libc/include/ipc/vfs.h
===================================================================
--- uspace/lib/libc/include/ipc/vfs.h	(revision ae75e2e3eeabda7f649cf80e1f0e25cbb7a7386e)
+++ uspace/lib/libc/include/ipc/vfs.h	(revision f7376cbf01eb650e5eb7ba3ffd5e9f8e1846e2dd)
@@ -101,5 +101,5 @@
  * No lookup flags used.
  */
-#define L_NONE  0
+#define L_NONE			0
 
 /**
@@ -108,12 +108,25 @@
  * with L_DIRECTORY.
  */
-#define L_FILE  1
+#define L_FILE			1
 
 /**
- * Lookup wil succeed only if the object is a directory. If L_CREATE is
+ * Lookup will succeed only if the object is a directory. If L_CREATE is
  * specified, an empty directory will be created. This flag is mutually
  * exclusive with L_FILE.
  */
-#define L_DIRECTORY  2
+#define L_DIRECTORY		2
+
+/**
+ * Lookup will succeed only if the object is a root directory. The flag is
+ * mutually exclusive with L_FILE and L_MP.
+ */
+#define L_ROOT			4
+
+/**
+ * Lookup will succeed only if the object is a mount point. The flag is mutually
+ * exclusive with L_FILE and L_ROOT.
+ */
+#define L_MP			8
+
 
 /**
@@ -121,15 +134,15 @@
  * object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used.
  */
-#define L_EXCLUSIVE  4
+#define L_EXCLUSIVE 		16
 
 /**
  * L_CREATE is used for creating both regular files and directories.
  */
-#define L_CREATE  8
+#define L_CREATE		32
 
 /**
  * L_LINK is used for linking to an already existing nodes.
  */
-#define L_LINK  16
+#define L_LINK			64
 
 /**
@@ -138,5 +151,5 @@
  * VFS_UNLINK.
  */
-#define L_UNLINK  32
+#define L_UNLINK		128
 
 /**
@@ -146,12 +159,5 @@
  * client.
  */
-#define L_OPEN  64
-
-/**
- * L_NOCROSS_LAST_MP is used exclusively during the VFS_IN_UNMOUNT operation. It
- * tells the lookup routine not to cross the last mount point in the lookup
- * path.
- */
-#define L_NOCROSS_LAST_MP	128
+#define L_OPEN			256
 
 #endif
Index: uspace/lib/libfs/libfs.c
===================================================================
--- uspace/lib/libfs/libfs.c	(revision ae75e2e3eeabda7f649cf80e1f0e25cbb7a7386e)
+++ uspace/lib/libfs/libfs.c	(revision f7376cbf01eb650e5eb7ba3ffd5e9f8e1846e2dd)
@@ -315,5 +315,5 @@
 
 		if ((tmp) && (tmp->mp_data.mp_active) &&
-		    (!(lflag & L_NOCROSS_LAST_MP) || (next <= last))) {
+		    (!(lflag & L_MP) || (next <= last))) {
 			if (next > last)
 				next = last = first;
@@ -486,4 +486,9 @@
 		goto out;
 	}
+
+	if ((lflag & L_ROOT) && par) {
+		ipc_answer_0(rid, EINVAL);
+		goto out;
+	}
 	
 out_with_answer:
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision ae75e2e3eeabda7f649cf80e1f0e25cbb7a7386e)
+++ uspace/srv/vfs/vfs_ops.c	(revision f7376cbf01eb650e5eb7ba3ffd5e9f8e1846e2dd)
@@ -459,5 +459,5 @@
 	 * Lookup the mounted root and instantiate it.
 	 */
-	rc = vfs_lookup_internal(mp, L_NONE, &mr_res, NULL);
+	rc = vfs_lookup_internal(mp, L_ROOT, &mr_res, NULL);
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
@@ -521,9 +521,5 @@
 		 */
 
-		/*
-		 * The L_NOCROSS_LAST_MP flag is essential if we really want to
-		 * lookup the mount point and not the mounted root.
-		 */
-		rc = vfs_lookup_internal(mp, L_NOCROSS_LAST_MP, &mp_res, NULL);
+		rc = vfs_lookup_internal(mp, L_MP, &mp_res, NULL);
 		free(mp);
 		if (rc != EOK) {
@@ -595,10 +591,10 @@
 	/*
 	 * Make sure that we are called with exactly one of L_FILE and
-	 * L_DIRECTORY. Make sure that the user does not pass L_OPEN or
-	 * L_NOCROSS_LAST_MP.
+	 * L_DIRECTORY. Make sure that the user does not pass L_OPEN,
+	 * L_ROOT or L_MP.
 	 */
 	if (((lflag & (L_FILE | L_DIRECTORY)) == 0) ||
 	    ((lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) ||
-	    (lflag & L_OPEN) || (lflag & L_NOCROSS_LAST_MP)) {
+	    (lflag & (L_OPEN | L_ROOT | L_MP))) {
 		ipc_answer_0(rid, EINVAL);
 		return;
