summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/recovery.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-07-12 13:01:57 +0200
committerRichard Weinberger <richard@nod.at>2018-08-15 00:25:21 +0200
commit6eb61d587f4515e4be5669eff383c0185009954f (patch)
treea5d3183e104338319152a888e0ff980c2546e6e1 /fs/ubifs/recovery.c
parent54169ddd382d461f7c01cc5a5182a4b4bc539489 (diff)
downloadlinux-0-day-6eb61d587f4515e4be5669eff383c0185009954f.tar.gz
linux-0-day-6eb61d587f4515e4be5669eff383c0185009954f.tar.xz
ubifs: Pass struct ubifs_info to ubifs_assert()
This allows us to have more context in ubifs_assert() and take different actions depending on the configuration. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/recovery.c')
-rw-r--r--fs/ubifs/recovery.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 3af4472061cc0..984e30e83c0b3 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -444,7 +444,7 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum,
dbg_rcvry("cleaning corruption at %d:%d", lnum, *offs);
- ubifs_assert(!(*offs & 7));
+ ubifs_assert(c, !(*offs & 7));
empty_offs = ALIGN(*offs, c->min_io_size);
pad_len = empty_offs - *offs;
ubifs_pad(c, *buf, pad_len);
@@ -644,7 +644,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
if (IS_ERR(sleb))
return sleb;
- ubifs_assert(len >= 8);
+ ubifs_assert(c, len >= 8);
while (len >= 8) {
dbg_scan("look at LEB %d:%d (%d bytes left)",
lnum, offs, len);
@@ -966,7 +966,7 @@ int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf)
{
int err;
- ubifs_assert(!c->ro_mount || c->remounting_rw);
+ ubifs_assert(c, !c->ro_mount || c->remounting_rw);
dbg_rcvry("checking index head at %d:%d", c->ihead_lnum, c->ihead_offs);
err = recover_head(c, c->ihead_lnum, c->ihead_offs, sbuf);
@@ -1187,8 +1187,8 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
return grab_empty_leb(c);
}
- ubifs_assert(!(lp.flags & LPROPS_INDEX));
- ubifs_assert(lp.free + lp.dirty >= wbuf->offs);
+ ubifs_assert(c, !(lp.flags & LPROPS_INDEX));
+ ubifs_assert(c, lp.free + lp.dirty >= wbuf->offs);
/*
* We run the commit before garbage collection otherwise subsequent
@@ -1216,7 +1216,7 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
return err;
}
- ubifs_assert(err == LEB_RETAINED);
+ ubifs_assert(c, err == LEB_RETAINED);
if (err != LEB_RETAINED)
return -EINVAL;
@@ -1507,7 +1507,7 @@ int ubifs_recover_size(struct ubifs_info *c)
struct inode *inode;
struct ubifs_inode *ui;
- ubifs_assert(!e->inode);
+ ubifs_assert(c, !e->inode);
inode = ubifs_iget(c->vfs_sb, e->inum);
if (IS_ERR(inode))