summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2018-11-12 05:24:30 -0500
committerDavid Sterba <dsterba@suse.com>2018-12-17 08:51:31 -0500
commit6d4cbf790307515dcd91eb2165e36e9b83d0fab6 (patch)
treef5cf2fffe859c73d154ca3ec8279dabefc7e582a
parent59b0713a8a6c0f72ab468507dcd6b866869b900a (diff)
Btrfs: remove no longer used io_err from btrfs_log_ctx
The io_err field of struct btrfs_log_ctx is no longer used after the recent simplification of the fast fsync path, where we now wait for ordered extents to complete before logging the inode. We did this in commit b5e6c3e170b7 ("btrfs: always wait on ordered extents at fsync time") and commit a2120a473a80 ("btrfs: clean up the left over logged_list usage") removed its last use. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/file.c19
-rw-r--r--fs/btrfs/tree-log.h2
2 files changed, 0 insertions, 21 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 58e93bce3036..3835bb8c146d 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2186,25 +2186,6 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
2186 up_write(&BTRFS_I(inode)->dio_sem); 2186 up_write(&BTRFS_I(inode)->dio_sem);
2187 inode_unlock(inode); 2187 inode_unlock(inode);
2188 2188
2189 /*
2190 * If any of the ordered extents had an error, just return it to user
2191 * space, so that the application knows some writes didn't succeed and
2192 * can take proper action (retry for e.g.). Blindly committing the
2193 * transaction in this case, would fool userspace that everything was
2194 * successful. And we also want to make sure our log doesn't contain
2195 * file extent items pointing to extents that weren't fully written to -
2196 * just like in the non fast fsync path, where we check for the ordered
2197 * operation's error flag before writing to the log tree and return -EIO
2198 * if any of them had this flag set (btrfs_wait_ordered_range) -
2199 * therefore we need to check for errors in the ordered operations,
2200 * which are indicated by ctx.io_err.
2201 */
2202 if (ctx.io_err) {
2203 btrfs_end_transaction(trans);
2204 ret = ctx.io_err;
2205 goto out;
2206 }
2207
2208 if (ret != BTRFS_NO_LOG_SYNC) { 2189 if (ret != BTRFS_NO_LOG_SYNC) {
2209 if (!ret) { 2190 if (!ret) {
2210 ret = btrfs_sync_log(trans, root, &ctx); 2191 ret = btrfs_sync_log(trans, root, &ctx);
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
index 767765031e59..0fab84a8f670 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -15,7 +15,6 @@
15struct btrfs_log_ctx { 15struct btrfs_log_ctx {
16 int log_ret; 16 int log_ret;
17 int log_transid; 17 int log_transid;
18 int io_err;
19 bool log_new_dentries; 18 bool log_new_dentries;
20 struct inode *inode; 19 struct inode *inode;
21 struct list_head list; 20 struct list_head list;
@@ -26,7 +25,6 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx,
26{ 25{
27 ctx->log_ret = 0; 26 ctx->log_ret = 0;
28 ctx->log_transid = 0; 27 ctx->log_transid = 0;
29 ctx->io_err = 0;
30 ctx->log_new_dentries = false; 28 ctx->log_new_dentries = false;
31 ctx->inode = inode; 29 ctx->inode = inode;
32 INIT_LIST_HEAD(&ctx->list); 30 INIT_LIST_HEAD(&ctx->list);