*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
switch(c) {
case 'a':
append_max = strtoul(optarg, &end, 0);
- if (append_max == 0 || *end) {
+ if (append_max < 2 || *end) {
fprintf(stderr, "%s: bad append option '%s'\n",
prog, optarg);
usage(prog);
break;
case 'w':
write_max = strtoul(optarg, &end, 0);
- if (write_max == 0 || *end) {
+ if (write_max < 2 || *end) {
fprintf(stderr, "%s: bad write option '%s'\n",
prog, optarg);
usage(prog);
if (rank == 0) {
write_size = (rand() % (write_max - 1)) + 1;
append_size = (rand() % (append_max - 1)) + 1;
- trunc_size = (rand() % ((trunc_max?: append_size)-1))+1;
+ trunc_size = (append_size == 1) ? 1 :
+ (rand() % ((trunc_max?: append_size)-1))+1;
trunc_offset = write_size + trunc_size;
if (verbose || n % 1000 == 0)