tux3: Fix tux3_iattrdirty() usages

Now, on some paths, mark_inode_dirty() is not called after
tux3_iattrdirty() was called.

E.g. If inode->i_ctime is same with current time, file_update_time()
skips to dirty inode.

	tux3_iattrdirty()
	file_update_time() {
	    if (!timespec_equal(&inode->i_ctime, &now))
		sync_it |= S_CTIME;
	    if (sync_it)
	        mark_inode_dirty_sync()
	}

This is wrong as tux3_iattrdirty() usage. tux3_iattrdirty() was
called, the caller must call mark_inode_dirty() too.

Otherwise,

	delta = 1
	tux3_iattrdirty(inode)
	    iattr_delta = delta

        /* flush delta 1 */
	inode is not dirty, so iattr_delta == 1 is remaining

	/* flush delta 2 for data pages */
	read_idata_for_i_size()
	    if (iattr_delta != delta)
		/*
		 * iattr_delta is still 1, so read from idata[], but
		 * idata[] is invalid.
		 */

By remaining iattr_delta, future inode flush is confused, and hits to
assertion.

To fix this, this makes sure to call tux3_iattrdirty() only when we call
mark_inode_dirty().

[FIXME: file_update_time() of mmap and write can race.]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
2 files changed