diff options
author | Barry Naujok <bnaujok@sgi.com> | 2008-06-02 21:59:18 -0400 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 02:58:46 -0400 |
commit | 87affd08bc9c741b99053cabb908cf54a135a0fa (patch) | |
tree | 27b72efbae045a45829a09e7e9a0109dc5f09b13 /fs/xfs | |
parent | 866d5dc974682c6247d5fde94dbc6545f864e7d7 (diff) |
[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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_dir2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index b445ec314764..80e0dc51361c 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c | |||
@@ -214,6 +214,7 @@ xfs_dir_createname( | |||
214 | return rval; | 214 | return rval; |
215 | XFS_STATS_INC(xs_dir_create); | 215 | XFS_STATS_INC(xs_dir_create); |
216 | 216 | ||
217 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
217 | args.name = name->name; | 218 | args.name = name->name; |
218 | args.namelen = name->len; | 219 | args.namelen = name->len; |
219 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); | 220 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); |
@@ -286,8 +287,8 @@ xfs_dir_lookup( | |||
286 | 287 | ||
287 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); | 288 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); |
288 | XFS_STATS_INC(xs_dir_lookup); | 289 | XFS_STATS_INC(xs_dir_lookup); |
289 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
290 | 290 | ||
291 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
291 | args.name = name->name; | 292 | args.name = name->name; |
292 | args.namelen = name->len; | 293 | args.namelen = name->len; |
293 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); | 294 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); |
@@ -297,7 +298,6 @@ xfs_dir_lookup( | |||
297 | args.op_flags = XFS_DA_OP_OKNOENT; | 298 | args.op_flags = XFS_DA_OP_OKNOENT; |
298 | if (ci_name) | 299 | if (ci_name) |
299 | args.op_flags |= XFS_DA_OP_CILOOKUP; | 300 | args.op_flags |= XFS_DA_OP_CILOOKUP; |
300 | args.cmpresult = XFS_CMP_DIFFERENT; | ||
301 | 301 | ||
302 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) | 302 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) |
303 | rval = xfs_dir2_sf_lookup(&args); | 303 | rval = xfs_dir2_sf_lookup(&args); |
@@ -343,6 +343,7 @@ xfs_dir_removename( | |||
343 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); | 343 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); |
344 | XFS_STATS_INC(xs_dir_remove); | 344 | XFS_STATS_INC(xs_dir_remove); |
345 | 345 | ||
346 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
346 | args.name = name->name; | 347 | args.name = name->name; |
347 | args.namelen = name->len; | 348 | args.namelen = name->len; |
348 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); | 349 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); |
@@ -353,7 +354,6 @@ xfs_dir_removename( | |||
353 | args.total = total; | 354 | args.total = total; |
354 | args.whichfork = XFS_DATA_FORK; | 355 | args.whichfork = XFS_DATA_FORK; |
355 | args.trans = tp; | 356 | args.trans = tp; |
356 | args.op_flags = 0; | ||
357 | 357 | ||
358 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) | 358 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) |
359 | rval = xfs_dir2_sf_removename(&args); | 359 | rval = xfs_dir2_sf_removename(&args); |
@@ -426,6 +426,7 @@ xfs_dir_replace( | |||
426 | if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) | 426 | if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) |
427 | return rval; | 427 | return rval; |
428 | 428 | ||
429 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
429 | args.name = name->name; | 430 | args.name = name->name; |
430 | args.namelen = name->len; | 431 | args.namelen = name->len; |
431 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); | 432 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); |
@@ -436,7 +437,6 @@ xfs_dir_replace( | |||
436 | args.total = total; | 437 | args.total = total; |
437 | args.whichfork = XFS_DATA_FORK; | 438 | args.whichfork = XFS_DATA_FORK; |
438 | args.trans = tp; | 439 | args.trans = tp; |
439 | args.op_flags = 0; | ||
440 | 440 | ||
441 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) | 441 | if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) |
442 | rval = xfs_dir2_sf_replace(&args); | 442 | rval = xfs_dir2_sf_replace(&args); |
@@ -472,8 +472,8 @@ xfs_dir_canenter( | |||
472 | return 0; | 472 | return 0; |
473 | 473 | ||
474 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); | 474 | ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR); |
475 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
476 | 475 | ||
476 | memset(&args, 0, sizeof(xfs_da_args_t)); | ||
477 | args.name = name->name; | 477 | args.name = name->name; |
478 | args.namelen = name->len; | 478 | args.namelen = name->len; |
479 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); | 479 | args.hashval = dp->i_mount->m_dirnameops->hashname(name); |