Skip to content

Commit 5b032ca

Browse files
committed
Merge tag 'ubifs-for-linus-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs
Pull JFFS2 and UBIFS fixes from Richard Weinberger: "JFFS2: - Correctly check return code of jffs2_prealloc_raw_node_refs() UBIFS: - Spelling fixes" * tag 'ubifs-for-linus-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: jffs2: check jffs2_prealloc_raw_node_refs() result in few other places jffs2: check that raw node were preallocated before writing summary ubifs: Fix grammar in error message
2 parents bdc7f8c + 2b6d965 commit 5b032ca

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

fs/jffs2/erase.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
425425
.totlen = cpu_to_je32(c->cleanmarker_size)
426426
};
427427

428-
jffs2_prealloc_raw_node_refs(c, jeb, 1);
428+
ret = jffs2_prealloc_raw_node_refs(c, jeb, 1);
429+
if (ret)
430+
goto filebad;
429431

430432
marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4));
431433

fs/jffs2/scan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
256256

257257
jffs2_dbg(1, "%s(): Skipping %d bytes in nextblock to ensure page alignment\n",
258258
__func__, skip);
259-
jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
259+
ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
260+
if (ret)
261+
goto out;
260262
jffs2_scan_dirty_space(c, c->nextblock, skip);
261263
}
262264
#endif

fs/jffs2/summary.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,10 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
858858
spin_unlock(&c->erase_completion_lock);
859859

860860
jeb = c->nextblock;
861-
jffs2_prealloc_raw_node_refs(c, jeb, 1);
861+
ret = jffs2_prealloc_raw_node_refs(c, jeb, 1);
862+
863+
if (ret)
864+
goto out;
862865

863866
if (!c->summary->sum_num || !c->summary->sum_list_head) {
864867
JFFS2_WARNING("Empty summary info!!!\n");
@@ -872,6 +875,8 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
872875
datasize += padsize;
873876

874877
ret = jffs2_sum_write_data(c, jeb, infosize, datasize, padsize);
878+
879+
out:
875880
spin_lock(&c->erase_completion_lock);
876881
return ret;
877882
}

fs/ubifs/journal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
985985
dbg_jnl("ino %lu, nlink %u", inode->i_ino, inode->i_nlink);
986986

987987
if (kill_xattrs && ui->xattr_cnt > ubifs_xattr_max_cnt(c)) {
988-
ubifs_err(c, "Cannot delete inode, it has too much xattrs!");
988+
ubifs_err(c, "Cannot delete inode, it has too many xattrs!");
989989
err = -EPERM;
990990
ubifs_ro_mode(c, err);
991991
return err;

0 commit comments

Comments
 (0)