Explorar o código

UBIFS: add a log overlap assertion

Add an assertion which checkes that the head of the log never overlaps with the
tail of the log.

Suggested-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Artem Bityutskiy %!s(int64=11) %!d(string=hai) anos
pai
achega
545f7fdf6d
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      fs/ubifs/misc.h

+ 1 - 0
fs/ubifs/misc.h

@@ -297,6 +297,7 @@ static inline int ubifs_next_log_lnum(const struct ubifs_info *c, int lnum)
 	if (lnum > c->log_last)
 		lnum = UBIFS_LOG_LNUM;
 
+	ubifs_assert(lnum != c->ltail_lnum);
 	return lnum;
 }