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

Commit 22276c81 authored by Nikhilesh Reddy's avatar Nikhilesh Reddy
Browse files

Merge branch 'ubifs_from_4.2.0-rc5' into 'msm-3.18'



UBIFS over UBI is the default filesystem used in QCOM chipsets
that use NAND storage.

There were a few changes upstream to UBIFS that fixed some bugs
and added some more asserts. There were also changes to the
debug messages that would allow for much easier debug of filesystem
issues.

Backport and bring in all the changes to ensure stability and
better performance for the NAND based devices.

* The patches included are:

  ubifs: fix to check error code of register_shrinker
  UBIFS: fix output format of INUM_WATERMARK
  UBIFS: extend debug/message capabilities
  UBIFS: simplify returns
  UBIFS: Fix trivial typos in comments
  UBIFS: do not write master node if need recovery
  UBIFS: fix incorrect unlocking handling
  UBIFS: return -EINVAL if log head is empty
  UBIFS: add a couple of extra asserts
  UBIFS: add ubifs_err() to print error reason
  UBIFS: Add security.* XATTR support for the UBIFS
  UBIFS: Add xattr support for symlinks
  UBIFS: fix a couple bugs in UBIFS xattr length calculation
  UBIFS: fix budget leak in error path

Change-Id: I5e76bb39daa85b0d798b030b15d07069144ba82e
Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parents 7af2265a f8f4c6a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ again:
			c->bi.nospace_rp = 1;
		smp_wmb();
	} else
		ubifs_err("cannot budget space, error %d", err);
		ubifs_err(c, "cannot budget space, error %d", err);
	return err;
}

+6 −6
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ out_cancel:
out_up:
	up_write(&c->commit_sem);
out:
	ubifs_err("commit failed, error %d", err);
	ubifs_err(c, "commit failed, error %d", err);
	spin_lock(&c->cs_lock);
	c->cmt_state = COMMIT_BROKEN;
	wake_up(&c->cmt_wq);
@@ -289,7 +289,7 @@ int ubifs_bg_thread(void *info)
	int err;
	struct ubifs_info *c = info;

	ubifs_msg("background thread \"%s\" started, PID %d",
	ubifs_msg(c, "background thread \"%s\" started, PID %d",
		  c->bgt_name, current->pid);
	set_freezable();

@@ -324,7 +324,7 @@ int ubifs_bg_thread(void *info)
		cond_resched();
	}

	ubifs_msg("background thread \"%s\" stops", c->bgt_name);
	ubifs_msg(c, "background thread \"%s\" stops", c->bgt_name);
	return 0;
}

@@ -712,13 +712,13 @@ out:
	return 0;

out_dump:
	ubifs_err("dumping index node (iip=%d)", i->iip);
	ubifs_err(c, "dumping index node (iip=%d)", i->iip);
	ubifs_dump_node(c, idx);
	list_del(&i->list);
	kfree(i);
	if (!list_empty(&list)) {
		i = list_entry(list.prev, struct idx_node, list);
		ubifs_err("dumping parent index node");
		ubifs_err(c, "dumping parent index node");
		ubifs_dump_node(c, &i->idx);
	}
out_free:
@@ -727,7 +727,7 @@ out_free:
		list_del(&i->list);
		kfree(i);
	}
	ubifs_err("failed, error %d", err);
	ubifs_err(c, "failed, error %d", err);
	if (err > 0)
		err = -EINVAL;
	return err;
+11 −11
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
 * Note, if the input buffer was not compressed, it is copied to the output
 * buffer and %UBIFS_COMPR_NONE is returned in @compr_type.
 */
void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
		    int *compr_type)
void ubifs_compress(const struct ubifs_info *c, const void *in_buf,
		    int in_len, void *out_buf, int *out_len, int *compr_type)
{
	int err;
	struct ubifs_compressor *compr = ubifs_compressors[*compr_type];
@@ -112,7 +112,7 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
	if (compr->comp_mutex)
		mutex_unlock(compr->comp_mutex);
	if (unlikely(err)) {
		ubifs_warn("cannot compress %d bytes, compressor %s, error %d, leave data uncompressed",
		ubifs_warn(c, "cannot compress %d bytes, compressor %s, error %d, leave data uncompressed",
			   in_len, compr->name, err);
		goto no_compr;
	}
@@ -144,21 +144,21 @@ no_compr:
 * The length of the uncompressed data is returned in @out_len. This functions
 * returns %0 on success or a negative error code on failure.
 */
int ubifs_decompress(const void *in_buf, int in_len, void *out_buf,
		     int *out_len, int compr_type)
int ubifs_decompress(const struct ubifs_info *c, const void *in_buf,
		     int in_len, void *out_buf, int *out_len, int compr_type)
{
	int err;
	struct ubifs_compressor *compr;

	if (unlikely(compr_type < 0 || compr_type >= UBIFS_COMPR_TYPES_CNT)) {
		ubifs_err("invalid compression type %d", compr_type);
		ubifs_err(c, "invalid compression type %d", compr_type);
		return -EINVAL;
	}

	compr = ubifs_compressors[compr_type];

	if (unlikely(!compr->capi_name)) {
		ubifs_err("%s compression is not compiled in", compr->name);
		ubifs_err(c, "%s compression is not compiled in", compr->name);
		return -EINVAL;
	}

@@ -175,7 +175,7 @@ int ubifs_decompress(const void *in_buf, int in_len, void *out_buf,
	if (compr->decomp_mutex)
		mutex_unlock(compr->decomp_mutex);
	if (err)
		ubifs_err("cannot decompress %d bytes, compressor %s, error %d",
		ubifs_err(c, "cannot decompress %d bytes, compressor %s, error %d",
			  in_len, compr->name, err);

	return err;
@@ -193,8 +193,8 @@ static int __init compr_init(struct ubifs_compressor *compr)
	if (compr->capi_name) {
		compr->cc = crypto_alloc_comp(compr->capi_name, 0, 0);
		if (IS_ERR(compr->cc)) {
			ubifs_err("cannot initialize compressor %s, error %ld",
				  compr->name, PTR_ERR(compr->cc));
			pr_err("UBIFS error (pid %d): cannot initialize compressor %s, error %ld",
			       current->pid, compr->name, PTR_ERR(compr->cc));
			return PTR_ERR(compr->cc);
		}
	}
+97 −93

File changed.

Preview size limit exceeded, changes collapsed.

+25 −6

File changed.

Preview size limit exceeded, changes collapsed.

Loading