mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
[XFS] Zero uninitialised xfs_da_args structure in xfs_dir2.c
Fixes a problem in the xfs_dir2_remove and xfs_dir2_replace paths which intenally call directory format specific lookup funtions that assume args->cmpresult is zeroed. SGI-PV: 982606 SGI-Modid: xfs-linux-melb:xfs-kern:31268a Signed-off-by: Barry Naujok <bnaujok@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
This commit is contained in:
parent
866d5dc974
commit
87affd08bc
@ -214,6 +214,7 @@ xfs_dir_createname(
|
|||||||
return rval;
|
return rval;
|
||||||
XFS_STATS_INC(xs_dir_create);
|
XFS_STATS_INC(xs_dir_create);
|
||||||
|
|
||||||
|
memset(&args, 0, sizeof(xfs_da_args_t));
|
||||||
args.name = name->name;
|
args.name = name->name;
|
||||||
args.namelen = name->len;
|
args.namelen = name->len;
|
||||||
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
||||||
@ -286,8 +287,8 @@ xfs_dir_lookup(
|
|||||||
|
|
||||||
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
||||||
XFS_STATS_INC(xs_dir_lookup);
|
XFS_STATS_INC(xs_dir_lookup);
|
||||||
memset(&args, 0, sizeof(xfs_da_args_t));
|
|
||||||
|
|
||||||
|
memset(&args, 0, sizeof(xfs_da_args_t));
|
||||||
args.name = name->name;
|
args.name = name->name;
|
||||||
args.namelen = name->len;
|
args.namelen = name->len;
|
||||||
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
||||||
@ -297,7 +298,6 @@ xfs_dir_lookup(
|
|||||||
args.op_flags = XFS_DA_OP_OKNOENT;
|
args.op_flags = XFS_DA_OP_OKNOENT;
|
||||||
if (ci_name)
|
if (ci_name)
|
||||||
args.op_flags |= XFS_DA_OP_CILOOKUP;
|
args.op_flags |= XFS_DA_OP_CILOOKUP;
|
||||||
args.cmpresult = XFS_CMP_DIFFERENT;
|
|
||||||
|
|
||||||
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
||||||
rval = xfs_dir2_sf_lookup(&args);
|
rval = xfs_dir2_sf_lookup(&args);
|
||||||
@ -343,6 +343,7 @@ xfs_dir_removename(
|
|||||||
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
||||||
XFS_STATS_INC(xs_dir_remove);
|
XFS_STATS_INC(xs_dir_remove);
|
||||||
|
|
||||||
|
memset(&args, 0, sizeof(xfs_da_args_t));
|
||||||
args.name = name->name;
|
args.name = name->name;
|
||||||
args.namelen = name->len;
|
args.namelen = name->len;
|
||||||
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
||||||
@ -353,7 +354,6 @@ xfs_dir_removename(
|
|||||||
args.total = total;
|
args.total = total;
|
||||||
args.whichfork = XFS_DATA_FORK;
|
args.whichfork = XFS_DATA_FORK;
|
||||||
args.trans = tp;
|
args.trans = tp;
|
||||||
args.op_flags = 0;
|
|
||||||
|
|
||||||
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
||||||
rval = xfs_dir2_sf_removename(&args);
|
rval = xfs_dir2_sf_removename(&args);
|
||||||
@ -426,6 +426,7 @@ xfs_dir_replace(
|
|||||||
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum)))
|
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum)))
|
||||||
return rval;
|
return rval;
|
||||||
|
|
||||||
|
memset(&args, 0, sizeof(xfs_da_args_t));
|
||||||
args.name = name->name;
|
args.name = name->name;
|
||||||
args.namelen = name->len;
|
args.namelen = name->len;
|
||||||
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
||||||
@ -436,7 +437,6 @@ xfs_dir_replace(
|
|||||||
args.total = total;
|
args.total = total;
|
||||||
args.whichfork = XFS_DATA_FORK;
|
args.whichfork = XFS_DATA_FORK;
|
||||||
args.trans = tp;
|
args.trans = tp;
|
||||||
args.op_flags = 0;
|
|
||||||
|
|
||||||
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
||||||
rval = xfs_dir2_sf_replace(&args);
|
rval = xfs_dir2_sf_replace(&args);
|
||||||
@ -472,8 +472,8 @@ xfs_dir_canenter(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
|
||||||
memset(&args, 0, sizeof(xfs_da_args_t));
|
|
||||||
|
|
||||||
|
memset(&args, 0, sizeof(xfs_da_args_t));
|
||||||
args.name = name->name;
|
args.name = name->name;
|
||||||
args.namelen = name->len;
|
args.namelen = name->len;
|
||||||
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
args.hashval = dp->i_mount->m_dirnameops->hashname(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user