Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20ebfcf5 authored by Paul Lawrence's avatar Paul Lawrence Committed by Blagovest Kolenichev
Browse files

ANDROID: Incremental fs: Fix four error-path bugs



Test: incfs_test passes
Bug: 158242405
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarPaul Lawrence <paullawrence@google.com>
Change-Id: Ib53e867fb2681489f720f6255354c1bce1d33997
(cherry picked from commit 60bc6eaf985358638af7f0602a7aece907ae8207)
Git-commit: a556403a
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 4c18ca46
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ struct data_file *incfs_open_data_file(struct mount_info *mi, struct file *bf)
out:
	if (error) {
		incfs_free_bfc(bfc);
		if (df)
			df->df_backing_file_context = NULL;
		incfs_free_data_file(df);
		return ERR_PTR(error);
@@ -1055,11 +1056,12 @@ int incfs_process_new_hash_block(struct data_file *df,
	}

	error = mutex_lock_interruptible(&bfc->bc_mutex);
	if (!error)
	if (!error) {
		error = incfs_write_hash_block_to_backing_file(
			bfc, range(data, block->data_len), block->block_index,
			hash_area_base, df->df_blockmap_off, df->df_size);
		mutex_unlock(&bfc->bc_mutex);
	}
	return error;
}

@@ -1112,6 +1114,9 @@ static int process_file_signature_md(struct incfs_file_signature *sg,
	void *buf = NULL;
	ssize_t read;

	if (!signature)
		return -ENOMEM;

	if (!df || !df->df_backing_file_context ||
	    !df->df_backing_file_context->bc_file) {
		error = -ENOENT;
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ static inline struct inode_info *get_incfs_node(struct inode *inode)
	if (!inode)
		return NULL;

	if (inode->i_sb->s_magic != INCFS_MAGIC_NUMBER) {
	if (inode->i_sb->s_magic != (long) INCFS_MAGIC_NUMBER) {
		/* This inode doesn't belong to us. */
		pr_warn_once("incfs: %s on an alien inode.", __func__);
		return NULL;