[LU-13907] /proc/filesystem doesn't list lustre as nodev Created: 12/Aug/20  Updated: 20/Sep/20  Resolved: 20/Sep/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.12.5
Fix Version/s: Lustre 2.12.6

Type: Question/Request Priority: Minor
Reporter: Mahmoud Hanafi Assignee: Andreas Dilger
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-12514 separate out the lustre mount code fo... Open
Rank (Obsolete): 9223372036854775807

 Description   

On a client when you load lustre module /proc/filesystem doesn't show lustre as nodev. How can we set the nodev option in /proc/filesystem.

We can mount the filesystem using nodev. Like this.
mount -t lustre -o flock,nodev,nosuid,noauto servernid@o2ib:/fs1 /fs1

# cat /proc/filesystems  | grep lustre
	lustre
bash-4.3# modinfo lustre
filename:       /lib/modules/4.12.14-122.23.1.20200609-nasa/updates/lustre-client/fs/lustre.ko
license:        GPL
version:        2.12.5
description:    Lustre Client File System
author:         OpenSFS, Inc. <http://www.lustre.org/>
suserelease:    SLE12-SP5
srcversion:     39FF3FF008B210E74B8D7D7
depends:        obdclass,ptlrpc,libcfs,lnet,lmv,mdc,lov
retpoline:      Y
vermagic:       4.12.14-122.23.1.20200609-nasa SMP mod_unload modversions 


 Comments   
Comment by James A Simmons [ 13/Aug/20 ]

This was fixed in LU-2.13.50 with commit 421d18c25b3143e9f2cabc1c0913475c03f739a4 (LU-12514 obdclass: discard FS_REQUIRES_DEV flag.). Its a bit tricky to fix since the same mount code is used for both the client (nodev) and the server targets (bdev). So we have to separate out the target and client mounting code first. This all has been done with the latest lustre code. 

Comment by Andreas Dilger [ 13/Aug/20 ]

Hi Mahmoud, is there a particular reason that it is important that the client is mounted with the "nodev" label?

Comment by Andreas Dilger [ 13/Aug/20 ]

It would be possible to implement a few-line fix for client-only builds by only including the FS_REQUIRES_DEV flag if HAVE_SERVER_SUPPORT is defined. While not as complete a fix as in master, this is sufficient for client-only builds, since the server would not be using those modules for its own mounts.

Something like the following (completely untested) patch would hopefully work:

diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c
index 73644e127d..d9bf708d54 100644
--- a/lustre/obdclass/obd_mount.c
+++ b/lustre/obdclass/obd_mount.c
@@ -1678,7 +1678,12 @@ static struct file_system_type lustre_fs_type = {
         .get_sb       = lustre_get_sb,
 #endif
         .kill_sb      = lustre_kill_super,
-        .fs_flags     = FS_REQUIRES_DEV | FS_HAS_FIEMAP | FS_RENAME_DOES_D_MOVE,
+       .fs_flags     = FS_HAS_FIEMAP | FS_RENAME_DOES_D_MOVE |
+#ifdef HAVE_SERVER_SUPPORT
+                        FS_REQUIRES_DEV,
+#else
+                        0,
+#endif
 };
 MODULE_ALIAS_FS("lustre");
 
Comment by Dale Talcott [ 13/Aug/20 ]

We run a security tool (BigFix) that scans all file systems except those marked as 'nodev' in /proc/filesystems. Of the network file systems we use, Lustre is the only one not marked with 'nodev'.

Comment by Gerrit Updater [ 13/Aug/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39674
Subject: LU-13907 llite: don't set FS_REQUIRES_DEV on client
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 00124e8c6989bcb6caf70e1cfed4db937ee2187e

Comment by Andreas Dilger [ 13/Aug/20 ]

This patch has not been tested yet, but if your need is urgent you are welcome to test it on an unimportant client node. IMHO, the risk of the change is very low.

Comment by Dale Talcott [ 14/Aug/20 ]

Jay built us a client Lustre with the patch. We installed it on one system and all seems okay so far. Plus, lustre is marked "nodev" in /proc/filesystems, as desired.

Comment by Peter Jones [ 15/Aug/20 ]

Thanks for the update Dale - that is good news!

Comment by Gerrit Updater [ 19/Sep/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39674/
Subject: LU-13907 llite: don't set FS_REQUIRES_DEV on client
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 76531b74d1280b93b6aa105e960819d806cc44f1

Comment by Peter Jones [ 20/Sep/20 ]

Landed for 2.12.6 and fixed as part of a larger change on master

Generated at Sat Feb 10 03:05:13 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.