Unverified Commit 3e1df672 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8263 [sync] PR-8228: ubifs: ubifs_link: Fix wrong name len calculating when UBIFS is encrypted

parents 013ea2f2 1185d9db
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -723,7 +723,7 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
	struct inode *inode = d_inode(old_dentry);
	struct ubifs_inode *ui = ubifs_inode(inode);
	struct ubifs_inode *dir_ui = ubifs_inode(dir);
	int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
	int err, sz_change;
	struct ubifs_budget_req req = { .new_dent = 1, .dirtied_ino = 2,
				.dirtied_ino_d = ALIGN(ui->data_len, 8) };
	struct fscrypt_name nm;
@@ -747,6 +747,8 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
	if (err)
		return err;

	sz_change = CALC_DENT_SIZE(fname_len(&nm));

	err = dbg_check_synced_i_size(c, inode);
	if (err)
		goto out_fname;