Commit d415867e authored by Lachlan McIlroy's avatar Lachlan McIlroy

[XFS] Use the incore inode size in xfs_file_readdir()

We should be using the incore inode size here not the linux inode
size.  The incore inode size is always up to date for directories
whereas the linux inode size is not updated for directories.

We've hit assertions in xfs_bmap() and traced it back to the linux
inode size being zero but the incore size being correct.
Reviewed-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent 27a0464a
...@@ -204,7 +204,7 @@ xfs_file_readdir( ...@@ -204,7 +204,7 @@ xfs_file_readdir(
* point we can change the ->readdir prototype to include the * point we can change the ->readdir prototype to include the
* buffer size. * buffer size.
*/ */
bufsize = (size_t)min_t(loff_t, PAGE_SIZE, inode->i_size); bufsize = (size_t)min_t(loff_t, PAGE_SIZE, ip->i_d.di_size);
error = xfs_readdir(ip, dirent, bufsize, error = xfs_readdir(ip, dirent, bufsize,
(xfs_off_t *)&filp->f_pos, filldir); (xfs_off_t *)&filp->f_pos, filldir);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment