[PVFS-users] pvfs_open, Invalid Argument

Todd McAnally tmcanally at tkmsoftware.com
Wed Mar 31 09:53:14 EST 2004


Sorry if this has already been covered.  I did some searching but 
didn't come up with exactly what I am seeing.

The problem is: when I call pvfs_open with O_META and pcount = -1 in 
the meta structure, I get an Invalid Argument (EINVAL) and pvfs_open 
fails.

I want to do this so I can set the stripe size. I believe pcount=-1 is 
supposed to use all nodes without having to explicitly state the count.

It worked the way I expected it to in 1.6.0 but now fails in 1.6.2.  I 
found some changes after 1.6.0 that appear to be my problem.

I'd appreciate it if someone would let me know if this is a real issue 
of if maybe it's just too dangerous for me to be poking around in the 
code. :-)

In lib/pvfs_open.c at line 221

---clip---
    /* otherwise we have a PVFS file... */
    /* Prepare request for file system */
    if (flag & O_META) {
       req.req.open.meta.p_stat.base = meta_p->base;
       niodservers = req.req.open.meta.p_stat.pcount = meta_p->pcount;
       req.req.open.meta.p_stat.ssize = meta_p->ssize;
    }
    else {
       req.req.open.meta.p_stat.base = -1;
       req.req.open.meta.p_stat.pcount = -1;
       req.req.open.meta.p_stat.ssize = -1;
       /*
        * default_alloc is initialized to a default-value which
        * would most likely be set to the total number of I/O servers
        * in the cluster. It is changed after the very first open
        */
       niodservers = pvfs_open_optimization ? default_alloc : 0;
    }
---clip---

With O_META set and pcount = -1, niodservers = -1 at the end of this 
code.
req.req.open.ackdsize gets set negative.  The first thing 
send_open_request does is check to see that ackdsize isn't negative.  
If so it fails with EINVAL.

I believe my hack to replace the above code given here is what was 
supposed to happen...
---clip---
  /* otherwise we have a PVFS file... */
    /* Prepare request for file system */
    if (flag & O_META) {
       req.req.open.meta.p_stat.base = meta_p->base;
       req.req.open.meta.p_stat.pcount = meta_p->pcount;
       req.req.open.meta.p_stat.ssize = meta_p->ssize;
    }
    else {
       req.req.open.meta.p_stat.base = -1;
       req.req.open.meta.p_stat.pcount = -1;
       req.req.open.meta.p_stat.ssize = -1;
    }

    /*
     * default_alloc is initialized to a default-value which
     * would most likely be set to the total number of I/O servers
     * in the cluster. It is changed after the very first open
     */
    if (req.req.open.meta.p_stat.pcount >= 0) {
       niodservers = req.req.open.meta.p_stat.pcount;
    } else {
       niodservers = pvfs_open_optimization ? default_alloc : 0;
    }
---clip---

My simple test framework now works.  I have yet to test in real code 
beyond my little test harness.

Did I do the right thing or am I way off in left field?

Thanks,
Todd




More information about the PVFS-users mailing list