* [PATCH 1/2] jbd2: check return value of blkdev_issue_flush()
@ 2012-08-13 3:38 Theodore Ts'o
2012-08-13 3:38 ` [PATCH 2/2] ext4: " Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2012-08-13 3:38 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Theodore Ts'o
blkdev_issue_flush() can fail; make sure the error gets properly
propagated.
This is a port of the equivalent jbd patch from commit 349ecd6a3c0e.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/jbd2/recovery.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index 0131e43..626846b 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -289,8 +289,11 @@ int jbd2_journal_recover(journal_t *journal)
if (!err)
err = err2;
/* Make sure all replayed data is on permanent storage */
- if (journal->j_flags & JBD2_BARRIER)
- blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
+ if (journal->j_flags & JBD2_BARRIER) {
+ err2 = blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
+ if (!err)
+ err = err2;
+ }
return err;
}
--
1.7.12.rc0.22.gcdd159b
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] ext4: check return value of blkdev_issue_flush()
2012-08-13 3:38 [PATCH 1/2] jbd2: check return value of blkdev_issue_flush() Theodore Ts'o
@ 2012-08-13 3:38 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2012-08-13 3:38 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Theodore Ts'o
blkdev_issue_flush() can fail; make sure the error gets properly
propagated.
This is a port of the equivalent ext3 patch from commit 44f4f729e7a1.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/fsync.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 2a1dcea..323eb15 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -203,7 +203,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
struct inode *inode = file->f_mapping->host;
struct ext4_inode_info *ei = EXT4_I(inode);
journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
- int ret;
+ int ret, err;
tid_t commit_tid;
bool needs_barrier = false;
@@ -255,8 +255,11 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
needs_barrier = true;
jbd2_log_start_commit(journal, commit_tid);
ret = jbd2_log_wait_commit(journal, commit_tid);
- if (needs_barrier)
- blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
+ if (needs_barrier) {
+ err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
+ if (!ret)
+ ret = err;
+ }
out:
mutex_unlock(&inode->i_mutex);
trace_ext4_sync_file_exit(inode, ret);
--
1.7.12.rc0.22.gcdd159b
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-13 3:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13 3:38 [PATCH 1/2] jbd2: check return value of blkdev_issue_flush() Theodore Ts'o
2012-08-13 3:38 ` [PATCH 2/2] ext4: " Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).