+ /* PUNCH_HOLE mode should always be accompanied with KEEP_SIZE flag
+ * Check that and add the missing flag for such invalid call with
+ * warning.
+ */
+ if (mode & FALLOC_FL_PUNCH_HOLE && !(mode & FALLOC_FL_KEEP_SIZE)) {
+ CWARN("%s: PUNCH mode misses KEEP_SIZE flag, setting it\n",
+ tsi->tsi_tgt->lut_obd->obd_name);
+ mode |= FALLOC_FL_KEEP_SIZE;
+ }
+