]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Btrfs: remove no longer used io_err from btrfs_log_ctx
authorFilipe Manana <fdmanana@suse.com>
Mon, 12 Nov 2018 10:24:30 +0000 (10:24 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:31 +0000 (14:51 +0100)
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>
fs/btrfs/file.c
fs/btrfs/tree-log.h

index 58e93bce30362dc0584c212ba18822ed13fde723..3835bb8c146d1b094911d7b32a0db50fb72b37c6 100644 (file)
@@ -2186,25 +2186,6 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
        up_write(&BTRFS_I(inode)->dio_sem);
        inode_unlock(inode);
 
-       /*
-        * If any of the ordered extents had an error, just return it to user
-        * space, so that the application knows some writes didn't succeed and
-        * can take proper action (retry for e.g.). Blindly committing the
-        * transaction in this case, would fool userspace that everything was
-        * successful. And we also want to make sure our log doesn't contain
-        * file extent items pointing to extents that weren't fully written to -
-        * just like in the non fast fsync path, where we check for the ordered
-        * operation's error flag before writing to the log tree and return -EIO
-        * if any of them had this flag set (btrfs_wait_ordered_range) -
-        * therefore we need to check for errors in the ordered operations,
-        * which are indicated by ctx.io_err.
-        */
-       if (ctx.io_err) {
-               btrfs_end_transaction(trans);
-               ret = ctx.io_err;
-               goto out;
-       }
-
        if (ret != BTRFS_NO_LOG_SYNC) {
                if (!ret) {
                        ret = btrfs_sync_log(trans, root, &ctx);
index 767765031e5994f9717b415c6c57a78a658fcf7a..0fab84a8f6708f693720606610b6672f69c58c7e 100644 (file)
@@ -15,7 +15,6 @@
 struct btrfs_log_ctx {
        int log_ret;
        int log_transid;
-       int io_err;
        bool log_new_dentries;
        struct inode *inode;
        struct list_head list;
@@ -26,7 +25,6 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx,
 {
        ctx->log_ret = 0;
        ctx->log_transid = 0;
-       ctx->io_err = 0;
        ctx->log_new_dentries = false;
        ctx->inode = inode;
        INIT_LIST_HEAD(&ctx->list);