/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/* Initialize the replication parameters */
int lr_init_status()
{
- size_t size = sizeof(struct lustre_rsync_status) + PATH_MAX;
+ size_t size = sizeof(struct lustre_rsync_status) + PATH_MAX + 1;
if (status != NULL)
return 0;
struct lustre_rsync_status *s;
int fd = -1;
size_t size;
- size_t read_size = sizeof(struct lustre_rsync_status) + PATH_MAX;
+ size_t read_size = sizeof(struct lustre_rsync_status) + PATH_MAX + 1;
int rc = 0;
if (statuslog == NULL)
}
status->ls_num_targets = s->ls_num_targets;
memcpy(status->ls_targets, s->ls_targets,
- PATH_MAX * s->ls_num_targets);
+ (PATH_MAX + 1) * s->ls_num_targets);
}
if (status->ls_last_recno == -1)
status->ls_last_recno = s->ls_last_recno;
case CL_XATTR:
rc = lr_setxattr(info);
break;
- case CL_CLOSE:
- case CL_EXT:
- case CL_OPEN:
- case CL_IOCTL:
- case CL_MARK:
- /* Nothing needs to be done for these entries */
- default:
- break;
- }
+ case CL_CLOSE:
+ case CL_EXT:
+ case CL_OPEN:
+ case CL_LAYOUT:
+ case CL_MARK:
+ /* Nothing needs to be done for these entries */
+ /* fallthrough */
+ default:
+ break;
+ }
DEBUG_EXIT(info, rc);
if (rc && rc != -ENOENT) {
lr_print_failure(info, rc);
status->ls_num_targets = numtargets;
}
newsize = sizeof (struct lustre_rsync_status) +
- (status->ls_num_targets * PATH_MAX);
+ (status->ls_num_targets * (PATH_MAX + 1));
if (status->ls_size != newsize) {
status->ls_size = newsize;
status = lr_grow_buf(status, newsize);