summaryrefslogtreecommitdiff
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2021-02-07 15:45:02 +0200
committerMichael Bestas <mkbestas@lineageos.org>2021-02-07 15:45:02 +0200
commit32ed4c6cace37c492b7deacdf3fa223618b1ad2e (patch)
tree0d247f7c30832c3137d9a868f95df59b19bf7712 /fs/ext4/namei.c
parent4d2544c30eab39bfe0eed6027fe4059f58ee91ad (diff)
parent0566f6529a7b8d15d8ff50797331717b346f9aa4 (diff)
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-msm8998
This brings LA.UM.9.2.r1-02000-SDMxx0.0 up to date with https://android.googlesource.com/kernel/common/ android-4.4-p at commit: 0566f6529a7b8 Merge 4.4.255 into android-4.4-p Conflicts: drivers/scsi/ufs/ufshcd.c drivers/usb/gadget/function/f_accessory.c drivers/usb/gadget/function/f_uac2.c net/core/skbuff.c Change-Id: I327c7f3793e872609f33f2a8e70eba7b580d70f3
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 574ca958aa2c..07e39985dc9f 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -3370,8 +3370,6 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent,
return retval;
}
}
- brelse(ent->bh);
- ent->bh = NULL;
return 0;
}
@@ -3574,6 +3572,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
}
}
+ old_file_type = old.de->file_type;
if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir))
ext4_handle_sync(handle);
@@ -3601,7 +3600,6 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
force_reread = (new.dir->i_ino == old.dir->i_ino &&
ext4_test_inode_flag(new.dir, EXT4_INODE_INLINE_DATA));
- old_file_type = old.de->file_type;
if (whiteout) {
/*
* Do this before adding a new entry, so the old entry is sure
@@ -3673,15 +3671,19 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
retval = 0;
end_rename:
- brelse(old.dir_bh);
- brelse(old.bh);
- brelse(new.bh);
if (whiteout) {
- if (retval)
+ if (retval) {
+ ext4_setent(handle, &old,
+ old.inode->i_ino, old_file_type);
drop_nlink(whiteout);
+ }
unlock_new_inode(whiteout);
iput(whiteout);
+
}
+ brelse(old.dir_bh);
+ brelse(old.bh);
+ brelse(new.bh);
if (handle)
ext4_journal_stop(handle);
return retval;