On Apr 20, 2012, at 4:13 PM, Myklebust, Trond wrote: > On Fri, 2012-04-20 at 19:57 +0000, Adamson, Dros wrote: >> On Apr 20, 2012, at 3:45 PM, Jim Rees wrote: >> >>> Weston Andros Adamson wrote: >>> >>> nfs4_path() was parsing the path component by splitting on the first colon. >>> This is wrong when an IPv6 address is used to mount a server. >>> >>> For example, having mounted 'fc00::10:/export', nfs4_path() returned >>> ':10:/export'. This causes referrals (using IPv4 or IPv6 addresses) to fail >>> in nfs4_validate_fspath(). >>> >>> Parsing the path component by using the *last* colon works with >>> IPv6 as well as IPv4 addrs. >>> >>> What if your mount is: >>> >>> server.edu:/export/:I-like-colons: >>> >>> It seems to me something has to give. Either we require v6 addresses be >>> enclosed in [], export dirs start with "/", or exports have no ":". >> >> >> Yeah, you're right. >> >> Although IPv6 addrs must be enclosed in [] to work with mount, it's always displayed in the kernel without the []. >> >> I suppose the correct fix is to always display IPv6 addresses enclosed in [], which might touch a *lot* of places. >> >> Thoughts? I'll wait for others to chime in before I go fixing this. I have a set of nfsd and mountd patches that deal with similar issues on the server side. I'll clean those up and submit them before getting back to this. > > We do know which part is the hostname, and which is the pathname. If you > look at "try_location()", you'll see that the hostname is stored in > location->servers, and is then copied into this empty buffer. > > If you want to test if that is an IPv6 address so that you can enclose > it in [], then that should be fairly easy to do right there... Yes, that's kind of what was I was thinking. -- Chuck Lever chuck[dot]lever[at]oracle[dot]com -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html