[OmniOS-discuss] LOFS LX chdir bug with steps to reproduce

Dan McDonald danmcd at omniti.com
Mon Jan 16 17:13:11 UTC 2017


Thank you for doing this!  Some questions in-line:

> On Jan 16, 2017, at 10:40 AM, Mini Trader <miniflowtrader at gmail.com> wrote:
> 
> I spent a bit of time yesterday using dtrace and looking at the source.  I believe I found why the system is falsely reporting that the current directory does not exist and have created a simple program to reproduce the problem.  The problem seems to be related to when v_path in the vnode struct goes above a certain number of characters.  This will only break on LOFS if inside the LX zone.  Every time a program performs a chdir('..') and up to another dir the system stored working directory is falsely growing.

Have you tried this on a native zone (just to make sure) as well?

> Here are the steps to reproduce.
> 
> 1. Mount a ZFS dataset via LOFS for your LX zone.
> 2. Create a directory in the dataset called test
> 3. In the test directory create another directory called 'Chdir Test'

Does it matter where (global zone, inside LX zone) these directories gets created?

> 4. Run the program below.  All this is doing is going up a directory and dropping down a directory.  We want to fill up v_path.

Python...

> 5. The program will bomb before iteration 1000.  Really there should be no limit.
> 
> import os
> import time
> 
> #time.sleep(15)
> os.chdir('/tank/bigtest/test')
> for i in xrange(1000):
>     print i
>     os.chdir('Chdir Test')
>     os.getcwd()
>     os.chdir('..')
> 
> I used the following dtrace to get insight into what was happening (ran it from global zone).
> 
> dtrace -n 'fbt:genunix:vnodetopath_common:entry /pid == $target/ { printf("%s\n",stringof(args[1]->v_path)) }' -q -x strsize=4k -p 22482
> 
> Uncomment the sleep line so that you can determine the PID when running dtrace.

I'm forwarding this note on to Joyent, so they can see what's going on.  I think this may be an LX bug, but I'm not sure.

Thanks,
Dan



More information about the OmniOS-discuss mailing list