[Pvfs2-users] PVFS_isys_io call: Invalid argument

g_p g_p g_p_java at hotmail.com
Tue Feb 21 13:59:19 EST 2012


Thanks, it worked

From: sampson at omnibond.com
To: pvfs2-users at beowulf-underground.org
Subject: RE: [Pvfs2-users] PVFS_isys_io call: Invalid argument
Date: Mon, 20 Feb 2012 14:49:37 -0500



I got the program to run without errors on OrangeFS 2.8.5. One potential issue is if the requested file (test2.txt) exists. PVFS_sys_create returns an error in this case, and because resp_create.ref isn’t populated, you get an invalid argument error from PVFS_sys_read. What I did was to specify different file names from the command line:                char working_file[PVFS_NAME_MAX];                . . . .                strcpy(working_file, argv[1]);                rc = PINT_get_base_dir(working_file. . .                . . . . You may need to inspect resp_create.ref.handle and resp_create.ref.fs_id. If either of those are 0 you will get the invalid argument error. Hope that helps,Sam From: pvfs2-users-bounces at beowulf-underground.org [mailto:pvfs2-users-bounces at beowulf-underground.org] On Behalf Of g_p g_p
Sent: Monday, February 20, 2012 2:25 PM
To: ligon at omnibond.com
Cc: pvfs2
Subject: RE: [Pvfs2-users] PVFS_isys_io call: Invalid argument I'm using pvfs-2.8.1 and my pvfs2-server.conf file is as follows:  <Defaults>        UnexpectedRequests 50        EventLogging none        EnableTracing no        LogStamp datetime        BMIModules bmi_tcp        FlowModules flowproto_multiqueue        PerfUpdateInterval 1000        ServerJobBMITimeoutSecs 30        ServerJobFlowTimeoutSecs 30        ClientJobBMITimeoutSecs 300        ClientJobFlowTimeoutSecs 300        ClientRetryLimit 5        ClientRetryDelayMilliSecs 2000        PrecreateBatchSize 512        PrecreateLowThreshold 256         StorageSpace /pvfs2-storage-space        LogFile /tmp/pvfs2-server.log</Defaults> <Aliases>        Alias mds1 tcp://mds1:3334        Alias client1 tcp://client1:3334</Aliases> <Filesystem>        Name pvfs2-fs        ID 1436645678        RootHandle 1048564        FileStuffing no        <MetaHandleRanges>                etc        </MetaHandleRanges>        <DataHandleRanges>                etc        </DataHandleRanges>        <StorageHints>                TroveSyncMeta yes                TroveSyncData no                TroveMethod alt-aio        </StorageHints></Filesystem>  Date: Mon, 20 Feb 2012 13:37:26 -0500
Subject: Re: [Pvfs2-users] PVFS_isys_io call: Invalid argument
From: ligon at omnibond.com
To: g_p_java at hotmail.com
CC: pvfs2-users at beowulf-underground.org

No.  I haven't tried to compile it.  

Which version of OrangeFS are you using?

Send me your PVFS configuration file.

Becky2012/2/20 g_p g_p <g_p_java at hotmail.com>a correction here ')' 

char *buffer = (char *) malloc( count * (sizeof(char) + 1)) From: g_p_java at hotmail.com
To: ligon at omnibond.com
Subject: RE: [Pvfs2-users] PVFS_isys_io call: Invalid argument
Date: Mon, 20 Feb 2012 20:21:23 +0200
CC: pvfs2-users at beowulf-underground.org 
Hello and thanks for replying,

i already did that

char *buffer = (char *) malloc( count * (sizeof(char) + 1)

but it didn't work too

Have you compiled it at all?
Does it work for you?

I'm sure i've made a mistake in the code, but i can't find it
and i have to find it as soon as possible cause i need it 

May you please help me?

ThanksDate: Mon, 20 Feb 2012 09:58:41 -0500
Subject: Re: [Pvfs2-users] PVFS_isys_io call: Invalid argument
From: ligon at omnibond.com
To: g_p_java at hotmail.com
CC: pvfs2-users at beowulf-underground.org

See below for correction. Becky2012/2/19 g_p g_p <g_p_java at hotmail.com>Hello, i'm trying to create a file and read from it.The creation is working fine. When i'm trying to read the file, i get an error when i call the "pvfs_sys_read" invalid (NULL) required argumentPVFS_isys_io call: Invalid argumentPVFS_sys_read : Invalid argument (error class: 0)  The problem is in the following line:" ret = PVFS_sys_read(resp_create.ref, file_req, 0,buffer, mem_req, &credentials, &resp_io, hints);"I can't understand which one of the arguments is causing the problem,can you understand?How can i solve it? The program is as follows: #include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <limits.h>#include <string.h>#include <sys/time.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <time.h>#include <libgen.h>#include <getopt.h>#include "pvfs2.h"  #include "str-utils.h"#include "pint-sysint-utils.h"#include "pvfs2-internal.h" #include "pvfs2-hint.h"  int main(void) {     int ret = -1;      PVFS_sys_layout layout;     layout.algorithm = PVFS_SYS_LAYOUT_ROUND_ROBIN;    layout.server_list.count = 0;    layout.server_list.servers = NULL;     /* Initialize the pvfs2 server */    ret = PVFS_util_init_defaults();    if(ret < 0)    {       PVFS_perror("PVFS_util_init_defaults", ret);        return -1;    }         int rc;        int num_segs;        char *working_file = "test2.txt";         char directory[PVFS_NAME_MAX] = "/mnt/pvfs2/testDir/";        char filename[PVFS_SEGMENT_MAX];         layout.algorithm = PVFS_SYS_LAYOUT_ROUND_ROBIN;        layout.server_list.count = 0;        if(layout.server_list.servers)        {            free(layout.server_list.servers);        }       layout.server_list.servers = NULL;         char pvfs_path[PVFS_NAME_MAX] = {0};        PVFS_fs_id cur_fs;        PVFS_sysresp_lookup resp_lookup;        PVFS_sysresp_create resp_create;        PVFS_credentials credentials;        PVFS_object_ref parent_ref;        PVFS_sys_attr attr;         /* Translate path into pvfs2 relative path */        rc = PINT_get_base_dir(working_file, directory, PVFS_NAME_MAX);        num_segs = PINT_string_count_segments(working_file);        rc = PINT_get_path_element(working_file, num_segs - 1,filename, PVFS_SEGMENT_MAX);         if (rc)        {            fprintf(stderr, "Unknown path format: %s\n", working_file);            ret = -1;         }        rc = PVFS_util_resolve(directory, &cur_fs,pvfs_path, PVFS_NAME_MAX);        if (rc)        {            PVFS_perror("PVFS_util_resolve", rc);            ret = -1;         }         PVFS_util_gen_credentials(&credentials);         memset(&resp_lookup, 0, sizeof(PVFS_sysresp_lookup));        rc = PVFS_sys_lookup(cur_fs, pvfs_path, &credentials,&resp_lookup, PVFS2_LOOKUP_LINK_NO_FOLLOW, NULL);        if (rc)        {            PVFS_perror("PVFS_sys_lookup", rc);            ret = -1;         }         /* Set attributes */        imemset(&attr, 0, sizeof(PVFS_sys_attr));        attr.owner = credentials.uid;        attr.group = credentials.gid;        attr.perms = 0777;        attr.atime = time(NULL);        attr.mtime = attr.atime;        attr.mask = PVFS_ATTR_SYS_ALL_SETABLE;        attr.dfile_count = 0;         parent_ref = resp_lookup.ref;         layout.algorithm = PVFS_SYS_LAYOUT_RANDOM;        lrc = PVFS_sys_create(filename,                             parent_ref,                             attr,                             parent_ref,                             attr,                             &credentials,                             NULL,                             &resp_create,                             &layout,                             NULL);        if (rc)        {           fprintf(stderr, "Error: An error occurred while creating %s\n",working_file);            PVFS_perror("PVFS_sys_create", rc);            ret = -1;         }        /* Everthing fine till here! */         PVFS_Request mem_req, file_req;        PVFS_sysresp_io resp_io; /*********       buffer needs to be allocated, at least 100 bytes in your case, then you can send in the *********       pointer to the PVFS_sys_read call.         char * buffer; *************/          size_t count = 100;         int64_t offset;        PVFS_hint hints = NULL;        file_req = PVFS_BYTE;        ret = PVFS_Request_contiguous(count, PVFS_BYTE, &mem_req);         if (ret < 0)        {           fprintf(stderr, "Error: PVFS_Request_contiguous failure\n");            return (ret);        }       ret = PVFS_sys_read(resp_create.ref, file_req, 0,buffer, mem_req, &credentials, &resp_io, hints); /* problem here!!! */        if (ret == 0)        {           PVFS_Request_free(&mem_req);         }       else {           PVFS_perror("PVFS_sys_read === ", ret);            printf("ret = %d\n",ret);        }    PVFS_sys_finalize();  }   Can you understand where the problem is?Where is that NULL value that causes the problem?Thanks, in advance   
_______________________________________________
Pvfs2-users mailing list
Pvfs2-users at beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users
 -- 
Becky Ligon
OrangeFS Support and Development
Omnibond Systems
Anderson, South Carolina


_______________________________________________ Pvfs2-users mailing list Pvfs2-users at beowulf-underground.org http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

-- 
Becky Ligon
OrangeFS Support and Development
Omnibond Systems
Anderson, South Carolina


_______________________________________________
Pvfs2-users mailing list
Pvfs2-users at beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.beowulf-underground.org/pipermail/pvfs2-users/attachments/20120221/020465b7/attachment-0001.htm


More information about the Pvfs2-users mailing list