diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 1cf1b9b8e97548af5122bc586feaaeddea3c03aa..268f3000d1b34d0e365f2eca252594d3a17505bb 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1587,7 +1587,7 @@ static inline int jbd2_space_needed(journal_t *journal) static inline unsigned long jbd2_log_space_left(journal_t *journal) { /* Allow for rounding errors */ - unsigned long free = journal->j_free - 32; + long free = journal->j_free - 32; if (journal->j_committing_transaction) { unsigned long committing = atomic_read(&journal-> @@ -1596,7 +1596,7 @@ static inline unsigned long jbd2_log_space_left(journal_t *journal) /* Transaction + control blocks */ free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT); } - return free; + return max_t(long, free, 0); } /*