aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2_node.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-08-25 10:13:35 +1000
committerDave Chinner <david@fromorbit.com>2015-08-25 10:13:35 +1000
commit70b33a7466baac62103e04c916b8915665b79d80 (patch)
tree14549cadf0ddb49f3392eb9869c62e3d5ec4ce20 /fs/xfs/libxfs/xfs_dir2_node.c
parentMerge branch 'xfs-misc-fixes-for-4.3-2' into for-next (diff)
parentxfs: fix non-debug build warnings (diff)
downloadlinux-dev-70b33a7466baac62103e04c916b8915665b79d80.tar.xz
linux-dev-70b33a7466baac62103e04c916b8915665b79d80.zip
Merge branch 'xfs-misc-fixes-for-4.3-3' into for-next
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index 6687489412a0..cc28e924545b 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -2131,6 +2131,7 @@ xfs_dir2_node_replace(
int error; /* error return value */
int i; /* btree level */
xfs_ino_t inum; /* new inode number */
+ int ftype; /* new file type */
xfs_dir2_leaf_t *leaf; /* leaf structure */
xfs_dir2_leaf_entry_t *lep; /* leaf entry being changed */
int rval; /* internal return value */
@@ -2144,7 +2145,14 @@ xfs_dir2_node_replace(
state = xfs_da_state_alloc();
state->args = args;
state->mp = args->dp->i_mount;
+
+ /*
+ * We have to save new inode number and ftype since
+ * xfs_da3_node_lookup_int() is going to overwrite them
+ */
inum = args->inumber;
+ ftype = args->filetype;
+
/*
* Lookup the entry to change in the btree.
*/
@@ -2182,7 +2190,7 @@ xfs_dir2_node_replace(
* Fill in the new inode number and log the entry.
*/
dep->inumber = cpu_to_be64(inum);
- args->dp->d_ops->data_put_ftype(dep, args->filetype);
+ args->dp->d_ops->data_put_ftype(dep, ftype);
xfs_dir2_data_log_entry(args, state->extrablk.bp, dep);
rval = 0;
}