diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-12-06 15:30:16 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-12-18 17:08:04 -0500 |
commit | 568d994e9f53657cb6b3e9c95a83c130d36f83c9 (patch) | |
tree | a4246ce0b646bc7859e04eaf601ab55e6cd23cdf /fs/xfs/xfs_attr_list.c | |
parent | 683cb941598d1d81283c940c100e0ce40f494105 (diff) |
xfs: use xfs_ilock_attr_map_shared in xfs_attr_list_int
We might not have read in the extent list at this point, so make sure we
take the ilock exclusively if we have to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r-- | fs/xfs/xfs_attr_list.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index 2d174b128153..01db96f60cf0 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c | |||
@@ -507,17 +507,17 @@ xfs_attr_list_int( | |||
507 | { | 507 | { |
508 | int error; | 508 | int error; |
509 | xfs_inode_t *dp = context->dp; | 509 | xfs_inode_t *dp = context->dp; |
510 | uint lock_mode; | ||
510 | 511 | ||
511 | XFS_STATS_INC(xs_attr_list); | 512 | XFS_STATS_INC(xs_attr_list); |
512 | 513 | ||
513 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 514 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
514 | return EIO; | 515 | return EIO; |
515 | 516 | ||
516 | xfs_ilock(dp, XFS_ILOCK_SHARED); | ||
517 | |||
518 | /* | 517 | /* |
519 | * Decide on what work routines to call based on the inode size. | 518 | * Decide on what work routines to call based on the inode size. |
520 | */ | 519 | */ |
520 | lock_mode = xfs_ilock_attr_map_shared(dp); | ||
521 | if (!xfs_inode_hasattr(dp)) { | 521 | if (!xfs_inode_hasattr(dp)) { |
522 | error = 0; | 522 | error = 0; |
523 | } else if (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) { | 523 | } else if (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) { |
@@ -527,9 +527,7 @@ xfs_attr_list_int( | |||
527 | } else { | 527 | } else { |
528 | error = xfs_attr_node_list(context); | 528 | error = xfs_attr_node_list(context); |
529 | } | 529 | } |
530 | 530 | xfs_iunlock(dp, lock_mode); | |
531 | xfs_iunlock(dp, XFS_ILOCK_SHARED); | ||
532 | |||
533 | return error; | 531 | return error; |
534 | } | 532 | } |
535 | 533 | ||