Re: xfs bug in 2.6.26-rc9

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lachlan McIlroy
Date: Monday, July 14, 2008 - 12:34 am

Mikael Abrahamsson wrote:

	xfs_ilock(ip, XFS_IOLOCK_SHARED);

	if (whichfork == XFS_DATA_FORK &&
		(ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
		/* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
		error = xfs_flush_pages(ip, (xfs_off_t)0,
					       -1, 0, FI_REMAPF);
		if (error) {
			xfs_iunlock(ip, XFS_IOLOCK_SHARED);
		return error;
		}
	}

	ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0);

This is a race between xfs_fsr and a mmap write.  xfs_fsr acquires the
iolock and then flushes the file and because it has the iolock it doesn't
expect any new delayed allocations to occur.  A mmap write can allocate
delayed allocations without acquiring the iolock so is able to get in
after the flush but before the ASSERT.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
xfs bug in 2.6.26-rc9, Mikael Abrahamsson, (Fri Jul 11, 12:46 am)
Re: xfs bug in 2.6.26-rc9, Dave Chinner, (Fri Jul 11, 1:42 am)
Re: xfs bug in 2.6.26-rc9, Mikael Abrahamsson, (Fri Jul 11, 3:21 am)
Re: xfs bug in 2.6.26-rc9, Sebastian Siewior, (Fri Jul 11, 12:02 pm)
Re: xfs bug in 2.6.26-rc9, Eric Sandeen, (Fri Jul 11, 12:52 pm)
Re: xfs bug in 2.6.26-rc9, Dave Chinner, (Fri Jul 11, 4:22 pm)
Re: xfs bug in 2.6.26-rc9, Sebastian Siewior, (Fri Jul 11, 10:06 pm)
Re: xfs bug in 2.6.26-rc9, Dave Chinner, (Mon Jul 14, 12:30 am)
Re: xfs bug in 2.6.26-rc9, Lachlan McIlroy, (Mon Jul 14, 12:34 am)
Re: xfs bug in 2.6.26-rc9, Mikael Abrahamsson, (Mon Jul 14, 1:16 am)
Re: xfs bug in 2.6.26-rc9, Dave Chinner, (Mon Jul 14, 5:13 am)
Re: xfs bug in 2.6.26-rc9, Lachlan McIlroy, (Mon Jul 14, 7:12 pm)
Re: xfs bug in 2.6.26-rc9, Dave Chinner, (Mon Jul 14, 8:18 pm)
Re: xfs bug in 2.6.26-rc9, Nick Piggin, (Mon Jul 14, 11:17 pm)
Re: xfs bug in 2.6.26-rc9, Christoph Hellwig, (Tue Jul 15, 5:22 am)
Re: xfs bug in 2.6.26-rc9, Nick Piggin, (Tue Jul 15, 9:12 pm)