[PATCH 4/4] UBIFS: add ubifs_err() to print error reason

Artem Bityutskiy dedekind1 at gmail.com
Tue Nov 11 03:10:35 PST 2014


Pushed this, but made some amendments.

Now all 4 are in the master branch. Would you please re-test them again
and confirm that they are fine. Then I'll push them to the linux-next
branch, unless you report that my amendments broke something.

Thank you!

On Fri, 2014-10-31 at 13:50 -0500, Ben Shelton wrote:
> @@ -100,24 +100,32 @@ static const struct file_operations empty_fops;
>  static int create_xattr(struct ubifs_info *c, struct inode *host,
>  			const struct qstr *nm, const void *value, int size)
>  {
> -	int err;
> +	int err, xattr_name_list_size;

Renamed this to a shorter names_len.

> -	if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE)
> +	if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE) {
> +		ubifs_err("ubifs xattr_cnt %d exceeds MAX_XATTR_PER_NODE (%d)",
> +			  host_ui->xattr_cnt, MAX_XATTRS_PER_INODE);

Improved this message - made it more user-friendly, and print the inode
number.

> +	if (xattr_name_list_size > XATTR_LIST_MAX) {
> +		ubifs_err("xattr name list too large %d > %d",
> +			  xattr_name_list_size, XATTR_LIST_MAX);
>  		return -ENOSPC;

Ditto.
>  
> +	if (err)
> +		ubifs_err("cannot initialize extended attribute, error %d",
> +			  err);

Refactored this message and added the inode number.

Artem.




More information about the linux-mtd mailing list