Commit 4188c78d951d8a44630f4c33bc0f5b63374572a4
Committed by
Lachlan McIlroy
1 parent
222096ae7f
Exists in
master
and in
7 other branches
[XFS] keep i_nlink updated and use proper accessors
To get the read-only bind mounts in -mm to work correctly with XFS we need to call the drop_nlink and inc_nlink helpers to monitor the link count. Add calls to these to xfs_bumplink and xfs_droplink and stop copying over di_nlink to i_nlink in xfs_validate_fields and vn_revalidate. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:30392a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Showing 3 changed files with 2 additions and 2 deletions Side-by-side Diff
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_vnode.c
fs/xfs/xfs_utils.c
... | ... | @@ -302,6 +302,7 @@ |
302 | 302 | |
303 | 303 | ASSERT (ip->i_d.di_nlink > 0); |
304 | 304 | ip->i_d.di_nlink--; |
305 | + drop_nlink(ip->i_vnode); | |
305 | 306 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
306 | 307 | |
307 | 308 | error = 0; |
... | ... | @@ -365,6 +366,7 @@ |
365 | 366 | |
366 | 367 | ASSERT(ip->i_d.di_nlink > 0); |
367 | 368 | ip->i_d.di_nlink++; |
369 | + inc_nlink(ip->i_vnode); | |
368 | 370 | if ((ip->i_d.di_version == XFS_DINODE_VERSION_1) && |
369 | 371 | (ip->i_d.di_nlink > XFS_MAXLINK_1)) { |
370 | 372 | /* |