[Gluster-devel] glfs_resolve new file force lookup

Shyam srangana at redhat.com
Mon Dec 1 15:43:49 UTC 2014


On 12/01/2014 07:25 AM, Rudra Siva wrote:
> The optimizations look good, I did find out that DHT is where the
> information is for the specific volume so that is working well for me.
>
> I'm testing for a 3 brick distributed volume at it gives the correct
> sub volume to batch up the writes.
>
> What gfapi is doing looks to be a little iffy to me (eg. glfs_creat) -
> based on resolution does open/create - consider the case that 2
> clients attempt to do a glfs_creat for the same file - the resolve may
> indicate failure to both and they both attempt creation.

and, one of them creates and the other does not, at this point it 
matters what the _flags_ for create were, if O_EXCL then the one that 
did not create would error out at glfs_creat and application request is 
satisfied (as per its flags sent), if not then both get an open file 
handle based on the flags.

Does this address the concern, or do you further see some issues?

>
> specifically the code in glfs_creat based on resolve:
>
> if (ret == 0) {
>          ret = syncop_open (subvol, &loc, flags, glfd->fd);
>                  DECODE_SYNCOP_ERR (ret);
>      } else {
>          ret = syncop_create (subvol, &loc, flags, mode, glfd->fd,
>                       xattr_req, &iatt);
>                  DECODE_SYNCOP_ERR (ret);
>      }
>

Shyam


More information about the Gluster-devel mailing list