diff options
| author | Takashi Iwai <tiwai@suse.de> | 2010-01-12 09:40:48 +0100 | 
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2010-01-12 09:40:48 +0100 | 
| commit | dba9532388b00d591d87c638a47dcc7ba3763fc5 (patch) | |
| tree | cc9de8cbc40d0e927b1924d1d943208e84e21d1f /fs/jbd2/commit.c | |
| parent | 78b8d5d2ee280c463908fd75f3bdf246bcb6ac8d (diff) | |
| parent | c68db7175f4dcb3d5789bb50bea6376fb81f87fe (diff) | |
Merge remote branch 'alsa/fixes' into fix/misc
Diffstat (limited to 'fs/jbd2/commit.c')
| -rw-r--r-- | fs/jbd2/commit.c | 19 | 
1 files changed, 11 insertions, 8 deletions
| diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 6a10238d2c6..1bc74b6f26d 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -259,6 +259,7 @@ static int journal_submit_data_buffers(journal_t *journal,  			ret = err;  		spin_lock(&journal->j_list_lock);  		J_ASSERT(jinode->i_transaction == commit_transaction); +		commit_transaction->t_flushed_data_blocks = 1;  		jinode->i_flags &= ~JI_COMMIT_RUNNING;  		wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);  	} @@ -708,8 +709,17 @@ start_journal_io:  		}  	} -	/* Done it all: now write the commit record asynchronously. */ +	/*  +	 * If the journal is not located on the file system device, +	 * then we must flush the file system device before we issue +	 * the commit record +	 */ +	if (commit_transaction->t_flushed_data_blocks && +	    (journal->j_fs_dev != journal->j_dev) && +	    (journal->j_flags & JBD2_BARRIER)) +		blkdev_issue_flush(journal->j_fs_dev, NULL); +	/* Done it all: now write the commit record asynchronously. */  	if (JBD2_HAS_INCOMPAT_FEATURE(journal,  				      JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) {  		err = journal_submit_commit_record(journal, commit_transaction, @@ -720,13 +730,6 @@ start_journal_io:  			blkdev_issue_flush(journal->j_dev, NULL);  	} -	/* -	 * This is the right place to wait for data buffers both for ASYNC -	 * and !ASYNC commit. If commit is ASYNC, we need to wait only after -	 * the commit block went to disk (which happens above). If commit is -	 * SYNC, we need to wait for data buffers before we start writing -	 * commit block, which happens below in such setting. -	 */  	err = journal_finish_inode_data_buffers(journal, commit_transaction);  	if (err) {  		printk(KERN_WARNING | 
