forked from Minki/linux
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: fix ->write_inode return values xfs: fix xfs_mark_inode_dirty during umount xfs: deprecate the nodelaylog mount option
This commit is contained in:
commit
4d7b5a116f
@ -592,3 +592,11 @@ Why: In 3.0, we can now autodetect internal 3G device and already have
|
|||||||
interface that was used by acer-wmi driver. It will replaced by
|
interface that was used by acer-wmi driver. It will replaced by
|
||||||
information log when acer-wmi initial.
|
information log when acer-wmi initial.
|
||||||
Who: Lee, Chun-Yi <jlee@novell.com>
|
Who: Lee, Chun-Yi <jlee@novell.com>
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
What: The XFS nodelaylog mount option
|
||||||
|
When: 3.3
|
||||||
|
Why: The delaylog mode that has been the default since 2.6.39 has proven
|
||||||
|
stable, and the old code is in the way of additional improvements in
|
||||||
|
the log code.
|
||||||
|
Who: Christoph Hellwig <hch@lst.de>
|
||||||
|
@ -70,9 +70,8 @@ xfs_synchronize_times(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the linux inode is valid, mark it dirty.
|
* If the linux inode is valid, mark it dirty, else mark the dirty state
|
||||||
* Used when committing a dirty inode into a transaction so that
|
* in the XFS inode to make sure we pick it up when reclaiming the inode.
|
||||||
* the inode will get written back by the linux code
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xfs_mark_inode_dirty_sync(
|
xfs_mark_inode_dirty_sync(
|
||||||
@ -82,6 +81,10 @@ xfs_mark_inode_dirty_sync(
|
|||||||
|
|
||||||
if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
|
if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
|
||||||
mark_inode_dirty_sync(inode);
|
mark_inode_dirty_sync(inode);
|
||||||
|
else {
|
||||||
|
barrier();
|
||||||
|
ip->i_update_core = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -92,6 +95,11 @@ xfs_mark_inode_dirty(
|
|||||||
|
|
||||||
if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
|
if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
|
||||||
mark_inode_dirty(inode);
|
mark_inode_dirty(inode);
|
||||||
|
else {
|
||||||
|
barrier();
|
||||||
|
ip->i_update_core = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -356,6 +356,8 @@ xfs_parseargs(
|
|||||||
mp->m_flags |= XFS_MOUNT_DELAYLOG;
|
mp->m_flags |= XFS_MOUNT_DELAYLOG;
|
||||||
} else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) {
|
} else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) {
|
||||||
mp->m_flags &= ~XFS_MOUNT_DELAYLOG;
|
mp->m_flags &= ~XFS_MOUNT_DELAYLOG;
|
||||||
|
xfs_warn(mp,
|
||||||
|
"nodelaylog is deprecated and will be removed in Linux 3.3");
|
||||||
} else if (!strcmp(this_char, MNTOPT_DISCARD)) {
|
} else if (!strcmp(this_char, MNTOPT_DISCARD)) {
|
||||||
mp->m_flags |= XFS_MOUNT_DISCARD;
|
mp->m_flags |= XFS_MOUNT_DISCARD;
|
||||||
} else if (!strcmp(this_char, MNTOPT_NODISCARD)) {
|
} else if (!strcmp(this_char, MNTOPT_NODISCARD)) {
|
||||||
@ -877,33 +879,17 @@ xfs_log_inode(
|
|||||||
struct xfs_trans *tp;
|
struct xfs_trans *tp;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
xfs_iunlock(ip, XFS_ILOCK_SHARED);
|
|
||||||
tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
|
tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
|
||||||
error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
|
error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
xfs_trans_cancel(tp, 0);
|
xfs_trans_cancel(tp, 0);
|
||||||
/* we need to return with the lock hold shared */
|
|
||||||
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
||||||
|
xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);
|
||||||
/*
|
|
||||||
* Note - it's possible that we might have pushed ourselves out of the
|
|
||||||
* way during trans_reserve which would flush the inode. But there's
|
|
||||||
* no guarantee that the inode buffer has actually gone out yet (it's
|
|
||||||
* delwri). Plus the buffer could be pinned anyway if it's part of
|
|
||||||
* an inode in another recent transaction. So we play it safe and
|
|
||||||
* fire off the transaction anyway.
|
|
||||||
*/
|
|
||||||
xfs_trans_ijoin(tp, ip);
|
|
||||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
||||||
error = xfs_trans_commit(tp, 0);
|
return xfs_trans_commit(tp, 0);
|
||||||
xfs_ilock_demote(ip, XFS_ILOCK_EXCL);
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
@ -918,7 +904,9 @@ xfs_fs_write_inode(
|
|||||||
trace_xfs_write_inode(ip);
|
trace_xfs_write_inode(ip);
|
||||||
|
|
||||||
if (XFS_FORCED_SHUTDOWN(mp))
|
if (XFS_FORCED_SHUTDOWN(mp))
|
||||||
return XFS_ERROR(EIO);
|
return -XFS_ERROR(EIO);
|
||||||
|
if (!ip->i_update_core)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (wbc->sync_mode == WB_SYNC_ALL) {
|
if (wbc->sync_mode == WB_SYNC_ALL) {
|
||||||
/*
|
/*
|
||||||
@ -929,12 +917,10 @@ xfs_fs_write_inode(
|
|||||||
* of synchronous log foces dramatically.
|
* of synchronous log foces dramatically.
|
||||||
*/
|
*/
|
||||||
xfs_ioend_wait(ip);
|
xfs_ioend_wait(ip);
|
||||||
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
error = xfs_log_inode(ip);
|
||||||
if (ip->i_update_core) {
|
if (error)
|
||||||
error = xfs_log_inode(ip);
|
goto out;
|
||||||
if (error)
|
return 0;
|
||||||
goto out_unlock;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* We make this non-blocking if the inode is contended, return
|
* We make this non-blocking if the inode is contended, return
|
||||||
|
Loading…
Reference in New Issue
Block a user