~ubuntu-branches/ubuntu/wily/glusterfs/wily

« back to all changes in this revision

Viewing changes to xlators/nfs/server/src/nfs3.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi, Louis Zuckerman, Patrick Matthäi
  • Date: 2011-05-01 14:41:05 UTC
  • mfrom: (1.3.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110501144105-l5dut674ggp5f2yr
Tags: 3.1.4-1
[ Louis Zuckerman ]
* New upstream release.
  - Add patch 01-remove-argp-m64-option.diff to allow 32bit builds.
* Enabled pure-server or pure-client installation.
  - Moved glusterfsd binary to libglusterfs0.
  - Added dependency on libglusterfs0 to -server and -client packages.
  - Removed dependency on glusterfs-client from glusterfs-server.
  - Moved manpages for binaries into their respective packages
* Updated default configuration files to 3.1-series versions
  - Added glusterd.vol to glusterfs-server, required for Elastic Volume Mgr.
  - Removed unnecessary 3.0-series sample volume-files from glusterfs-server
  Closes: #615166
* Replaced init-script for glusterfs-server with new 3.1-series version.
  Closes: #615859

[ Patrick Matthäi ]
* Bump Standards-Version to 3.9.2 (no changes needed).
* Build with hardening-wrapper.
* Comment out all dependency_libs lines in .la files.
  Closes: #621169
* Add logrotate script to the libglusterfs0 package.
  Closes: #623234
* Remove rpath from all libs and binaries.
* Add patch 02-fix-spelling-errors.diff, which fixes multiple spelling errors
  in the source code.
* Add lintian overrides for the libglusterfs0 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2361
2361
        if (!cs)
2362
2362
                return ret;
2363
2363
 
2364
 
        if ((cs->createmode == UNCHECKED) || (cs->createmode = EXCLUSIVE))
 
2364
        if (cs->createmode == UNCHECKED)
2365
2365
                flags = O_RDWR;
2366
2366
        else if (cs->createmode == GUARDED)
2367
2367
                flags = (O_RDWR | O_EXCL);
2401
2401
                goto nfs3err;
2402
2402
        }
2403
2403
 
2404
 
        if (cs->preparent.ia_mtime == buf->ia_mtime)
 
2404
        if ((cs->stbuf.ia_mtime == buf->ia_mtime) &&
 
2405
            (cs->stbuf.ia_atime == buf->ia_atime)) {
 
2406
                gf_log (GF_NFS3, GF_LOG_DEBUG, "Create req retransmitted verf %x %x",
 
2407
                        cs->stbuf.ia_mtime, cs->stbuf.ia_atime);
2405
2408
                stat = NFS3_OK;
2406
 
        else
 
2409
                nfs3_fh_build_child_fh (&cs->parent, buf, &cs->fh);
 
2410
        } else {
 
2411
                gf_log (GF_NFS3, GF_LOG_DEBUG, "File already exist new_verf %x %x"
 
2412
                        "old_verf %x %x", cs->stbuf.ia_mtime, cs->stbuf.ia_atime,
 
2413
                        buf->ia_mtime, buf->ia_atime);
2407
2414
                stat = NFS3ERR_EXIST;
 
2415
        }
2408
2416
 
2409
2417
nfs3err:
2410
2418
        if (ret < 0) {
2411
2419
                nfs3_log_common_res (nfs_rpcsvc_request_xid (cs->req), "CREATE",
2412
2420
                                     stat, op_errno);
2413
 
                nfs3_create_reply (cs->req, stat, NULL, NULL, NULL, NULL);
 
2421
                nfs3_create_reply (cs->req, stat, &cs->fh, buf, NULL, NULL);
2414
2422
                nfs3_call_state_wipe (cs);
2415
2423
        }
2416
2424
 
2427
2435
        if (!cs)
2428
2436
                return ret;
2429
2437
 
2430
 
        /* HACK warning. */
2431
 
        cs->preparent.ia_mtime = cs->cookieverf;
2432
 
        cs->preparent.ia_atime = 9669;
 
2438
        /* Storing verifier as a mtime and atime attribute, to store it
 
2439
         * in stable storage */
 
2440
        cs->stbuf.ia_atime = (cs->cookieverf & 0xFFFFFFFF00000000);
 
2441
        cs->stbuf.ia_mtime = (cs->cookieverf & 0x00000000FFFFFFFF);
 
2442
        cs->setattr_valid |= GF_SET_ATTR_ATIME;
 
2443
        cs->setattr_valid |= GF_SET_ATTR_MTIME;
2433
2444
        nfs_request_user_init (&nfu, cs->req);
2434
2445
 
2435
2446
        /* If the file already existed we need to get that attributes so we can
2512
2523
        nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err);
2513
2524
 
2514
2525
        cs->cookieverf = cverf;
2515
 
        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, NULL,
 
2526
        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
2516
2527
                                                          &cs->mode);
2517
2528
        cs->createmode = mode;
2518
2529
        cs->parent = *dirfh;
2720
2731
        nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err);
2721
2732
 
2722
2733
        cs->parent = *dirfh;
2723
 
        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, NULL,
 
2734
        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
2724
2735
                                                          &cs->mode);
2725
2736
        ret = nfs3_fh_resolve_and_resume (cs, dirfh, name, nfs3_mkdir_resume);
2726
2737
        if (ret < 0)
3149
3160
        case NF3BLK:
3150
3161
                cs->devnums = nodedata->mknoddata3_u.device.spec;
3151
3162
                sattr = &nodedata->mknoddata3_u.device.dev_attributes;
3152
 
                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, NULL,
 
3163
                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
3153
3164
                                                                  &cs->mode);
3154
3165
                break;
3155
3166
        case NF3SOCK:
3156
3167
        case NF3FIFO:
3157
3168
                sattr = &nodedata->mknoddata3_u.pipe_attributes;
3158
 
                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, NULL,
 
3169
                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
3159
3170
                                                                  &cs->mode);
3160
3171
                break;
3161
3172
        default: