[LU-6990] write error: Invalid argument when trying to set nosquash_nids Created: 12/Aug/15  Updated: 16/Jan/16  Resolved: 26/Aug/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.4
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Bruno Travouillon (Inactive) Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: None
Environment:

Lustre 2.5.3.90


Issue Links:
Related
is related to LU-1778 Root Squash is not always properly en... Closed
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Since our update from 2.5.3 to 2.5.3.90, we can't set the nosquash_nids parameter by writing into the procfile /proc/fs/lustre/mdt/scratch-MDT0000/nosquash_nids.

This is the method used by the shine tool for setting all the parameters.

[root@mds2 ~]# echo "192.168.101.13@tcp" > /proc/fs/lustre/mdt/scratch-MDT0000/nosquash_nids
-bash: echo: write error: Invalid argument

However, it works with 'lctl set_param' or 'echo -n'.

[root@mds2 ~]# echo -n "192.168.101.13@tcp" > /proc/fs/lustre/mdt/scratch-MDT0000/nosquash_nids
[root@mds2 ~]# cat /proc/fs/lustre/mdt/scratch-MDT0000/nosquash_nids
192.168.101.13@tcp
[root@mds2 ~]# lctl set_param mdt.scratch-MDT0000.nosquash_nids=192.168.0.13@tcp
mdt.scratch-MDT0000.nosquash_nids=192.168.0.13@tcp
[root@mds2 ~]# cat /proc/fs/lustre/mdt/scratch-MDT0000/nosquash_nids
192.168.0.13@tcp

It is related to LU-1778. The bug is in lprocfs_wr_nosquash_nids(). See lustre/obdclass/lprocfs_status.c (b2_5 branch, commit d82b4f54):

2789     if (count > 0 && kernbuf[count - 1] == '\n')
2790         kernbuf[count - 1] = '\0';

I don't understand why we need to replace \n by \0 since the nid parser seems to handle the newline.

Please let me know if you need further details.



 Comments   
Comment by Peter Jones [ 12/Aug/15 ]

Emoly

Could you please assist with this one?

Thanks

Peter

Comment by Emoly Liu [ 14/Aug/15 ]

Bruno, I think I know why that patch added "kernbuf[count - 1] = '\0';".
If you try to echo "NONE" to "clear" to parameter nosquash_nids against branch 2.5.3, you will see "write error: Invalid argument". Instead, that works well in 2.5.3.90.

I will post a patch to fix it.

Comment by Gerrit Updater [ 14/Aug/15 ]

Emoly Liu (emoly.liu@intel.com) uploaded a new patch: http://review.whamcloud.com/15985
Subject: LU-6990 lproc: set parameter nosquash_nids correctly
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7d7d1e640e3b7576e88d4507e72e815ed0140981

Comment by Gerrit Updater [ 20/Aug/15 ]

Grégoire Pichon (gregoire.pichon@bull.net) uploaded a new patch: http://review.whamcloud.com/16034
Subject: LU-6990 lproc: set parameter nosquash_nids correctly
Project: fs/lustre-release
Branch: b2_5
Current Patch Set: 1
Commit: 84965970e51ad5b3c14d9abad3789192585be9bc

Comment by Gerrit Updater [ 26/Aug/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15985/
Subject: LU-6990 lproc: set parameter nosquash_nids correctly
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 62d3b85f7d82bf7c76a84326a22b3139678f9d97

Comment by Joseph Gmitter (Inactive) [ 26/Aug/15 ]

Landed for 2.8.

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