public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ubifs: remove unnecessary check in ubifs_log_start_commit
@ 2018-08-21  3:17 Liu Song
  2018-08-21  6:25 ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Song @ 2018-08-21  3:17 UTC (permalink / raw)
  To: richard, dedekind1, adrian.hunter
  Cc: linux-mtd, linux-kernel, liu.song11, jiang.biao2, zhong.weidong

The value of c->lhead_offs cannot exceed max_len which much
smaller than c->leb_size. So the check will never be true.
Just remove it.

Signed-off-by: Liu Song <liu.song11@zte.com.cn>
Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
---
 fs/ubifs/log.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c
index 7cffa120a750..5a338737223b 100644
--- a/fs/ubifs/log.c
+++ b/fs/ubifs/log.c
@@ -427,10 +427,6 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum)
 	*ltail_lnum = c->lhead_lnum;
 
 	c->lhead_offs += len;
-	if (c->lhead_offs == c->leb_size) {
-		c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum);
-		c->lhead_offs = 0;
-	}
 
 	remove_buds(c);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread
[parent not found: <201808211457448170622@zte.com.cn>]

end of thread, other threads:[~2018-08-21  7:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21  3:17 [PATCH] ubifs: remove unnecessary check in ubifs_log_start_commit Liu Song
2018-08-21  6:25 ` Richard Weinberger
     [not found] <201808211457448170622@zte.com.cn>
2018-08-21  7:41 ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox