Support for Linux 3.0 kernels (LU-812)

[LU-1718] fix Lustre NFS re-export for 3.0+ kernels Created: 07/Aug/12  Updated: 04/Dec/12  Resolved: 04/Dec/12

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

Type: Technical task Priority: Major
Reporter: Andreas Dilger Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-1646 mounting lustre oops on older kernels Resolved
is related to LU-812 Support for Linux 3.0 kernels Resolved
Rank (Obsolete): 4062

 Description   

During the LU-812 patch series to implement Linux 3.0 client support for Lustre, lustre_mount() was changed to remove the struct vfsmnt argument that was previously available to lustre_get_sb(). The lack of struct vfsmnt argument complicates the ability to re-export the Lustre client filesystem via NFS, due to the BUG_ON(!mnt) in dentry_open().

It seems rather unfortunate/unfair that the default get_name() function is passed the "mnt" argument, while the filesystem-specific get_name() is not. I don't know if this is due to technical or ideological reasons.

The simplest fix would would be to see if we can get a patch submitted upstream and to SLES SP3 to pass the "mnt" argument to the ->get_name() method, but this may hit objections and would take time in any case.

Another way to fix this, as btrfs_get_name() and gfs2_get_name() have done, is to implement the name lookup part of the code internally, without using the VFS readdir() code to do it. This is considerably more complex, since it would mean duplicating or refactoring ll_readdir(), ll_get_dir_page(), and ll_dir_readpage() to avoid the use of filp/file arguments so that it can be called directly from ll_get_name().

A major hack would be to stash the vfsmnt from some function like ll_getattr into sbi->ll_mnt, but this has the danger that the vfsmnt might change during runtime without Lustre being notified of it.



 Comments   
Comment by Andreas Dilger [ 07/Aug/12 ]

Actual change introducing this problem is http://review.whamcloud.com/1951, since there are several patches landing under LU-812.

Comment by James A Simmons [ 13/Aug/12 ]

I also thought about the hack of storing ll_mnt from some other function. Looking at the code it doesn't look to bad to refactor it much like btrfs and gfs2 does it. I have a patch I'm doing basic testing to right now that I can post soon.

Comment by James A Simmons [ 13/Aug/12 ]

Okay this is a rough first patch, http://review.whamcloud.com/#change,3624. Most likely I missed some thing so feel free to tear it apart.

Comment by James A Simmons [ 27/Aug/12 ]

Patch updated for master.

Comment by James A Simmons [ 30/Aug/12 ]

I have a patch ready for NFS export testing for Lustre 2.1. The question is should http://review.whamcloud.com/#change,3661 be redone without the NFS disable part in llite_lib.c
and I submit my patch for this part or should I make my NFS patch dependent on the LU-812 patch for b2_1 as is?

Comment by Bob Glossman (Inactive) [ 30/Aug/12 ]

James, I think you should make your NFS patch dependent on the LU-812 patch for b2_1 as is. As far as I can see your patch is only needed if and when http://review.whamcloud.com/#change,3661 is accepted and merged.

Comment by Peter Jones [ 04/Dec/12 ]

Landed for 2.4

Comment by James A Simmons [ 04/Dec/12 ]

Their is still a patch outstanding for b2_1

Comment by Peter Jones [ 04/Dec/12 ]

James we track those differently

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