[LU-1833] Don't update mtab if it is symlink Created: 05/Sep/12  Updated: 16/Nov/16  Resolved: 07/Oct/12

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.3.0, Lustre 2.4.0
Fix Version/s: Lustre 2.4.0, Lustre 2.1.4

Type: Improvement Priority: Minor
Reporter: Peng Tao Assignee: Keith Mannthey (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Attachments: File 0001-LU-1833-util-fully-resolve-etc-mtab-to-detect-proc-s.patch    
Issue Links:
Duplicate
is duplicated by LU-2168 mount.lustre: addmntent: Invalid argu... Resolved
Rank (Obsolete): 4403

 Description   

some distros (like Fedora 16) link /etc/mtab to /proc/mounts. In such distros, mount.lustre cannot update mtab otherwise we false alarm user with errors.



 Comments   
Comment by Peng Tao [ 05/Sep/12 ]

patch submitted:
http://review.whamcloud.com/3881

Comment by Peter Jones [ 07/Oct/12 ]

Landed for 2.4

Comment by Shuichi Ihara (Inactive) [ 10/Dec/12 ]

Although this was already closed, we needed this backport patches to b2_1 and b1_8 for diskless lustre environment.

http://review.whamcloud.com/#change,4786 (b1_8)
http://review.whamcloud.com/#change,4785 (b2_1)

Comment by Carlos Thomaz [ 25/Mar/13 ]

Hi.
Another DDN customer is concerning about this issue. Running Lustre 2.1.3
Any feedback if this patch will be backported to 2.1 and 1.8 versions?

Thanks
Carlos.

Comment by Peter Jones [ 25/Mar/13 ]

Carlos

This fix was included in the 2.1.4 release. Ihara has already ported the fix to b1_8 and that patch can be applied anywhere that needs it.

Peter

Comment by Alexey Shvetsov [ 07/May/13 ]

This bug still here on 2.4
delta ~ # mount.lustre bootsrv@tcp:/home /home
mount.lustre: addmntent: Invalid argument:

ls -l /etc/mtab
lrwxrwxrwx 1 root root 14 Jun 21 2011 /etc/mtab -> ../proc/mounts

Comment by Keith Mannthey (Inactive) [ 07/May/13 ]

What distro are you using?

Comment by Alexey Shvetsov [ 07/May/13 ]

Gentoo. Client code was build from master + some patches to make 3.8 kernel work

Comment by Tyson Whitehead [ 16/Nov/16 ]

Would add that this patch doesn't work on recent fedora as systemd creates /etc/mtab as a symlink to ../proc/self/mounts which doesn't match the check for it starting with /proc/.

$ readlink /etc/mtab
../proc/self/mounts

A simple hack would be to switch to strstr to see if the symlink contains /proc/ anywhere in it or, to be 100% correct, use realpath to fully get the canonical absolute path.

$ realpath /etc/mtab
/proc/19506/mounts

Cheers! -Tyson

Comment by Tyson Whitehead [ 16/Nov/16 ]

Patch to switch to from readpath to realpath. Can confirm it works with my indirect symlink. Haven't tested a non-symlink setup.

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