- rc = llapi_file_get_stripe(argv[3], lum_file2);
- if (rc) {
- llapi_error(LLAPI_MSG_ERROR, rc,
- "error: can't get EA for %s\n", argv[3]);
- goto cleanup;
- }
- }
+ if (argc == 4) {
+ lum_file2 = (struct lov_user_md *)malloc(lum_size);
+ if (lum_file2 == NULL) {
+ rc = -ENOMEM;
+ llapi_error(LLAPI_MSG_ERROR, rc,
+ "error: can't allocate %d "
+ "bytes for file2 EA", lum_size);
+ goto cleanup;
+ }
+
+ rc = llapi_file_get_stripe(argv[3], lum_file2);
+ if (rc) {
+ llapi_error(LLAPI_MSG_ERROR, rc,
+ "error: can't get EA for %s", argv[3]);
+ goto cleanup;
+ }
+ }