Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Filipe Manana and committed by
David Sterba
6d4cbf79 59b0713a

-21
-19
fs/btrfs/file.c
··· 2186 2186 up_write(&BTRFS_I(inode)->dio_sem); 2187 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 2189 if (ret != BTRFS_NO_LOG_SYNC) { 2209 2190 if (!ret) { 2210 2191 ret = btrfs_sync_log(trans, root, &ctx);
-2
fs/btrfs/tree-log.h
··· 15 15 struct btrfs_log_ctx { 16 16 int log_ret; 17 17 int log_transid; 18 - int io_err; 19 18 bool log_new_dentries; 20 19 struct inode *inode; 21 20 struct list_head list; ··· 25 26 { 26 27 ctx->log_ret = 0; 27 28 ctx->log_transid = 0; 28 - ctx->io_err = 0; 29 29 ctx->log_new_dentries = false; 30 30 ctx->inode = inode; 31 31 INIT_LIST_HEAD(&ctx->list);