All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx
@ 2018-11-12 10:24 fdmanana
  2018-11-12 10:26 ` Nikolay Borisov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fdmanana @ 2018-11-12 10:24 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

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.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/file.c     | 19 -------------------
 fs/btrfs/tree-log.h |  2 --
 2 files changed, 21 deletions(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 6483757f0c09..65b3bcda99e2 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2157,25 +2157,6 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
 	 */
 	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);
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
index 7ab9bb88a639..a1e14ee26c54 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -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);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx
  2018-11-12 10:24 [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx fdmanana
@ 2018-11-12 10:26 ` Nikolay Borisov
  2018-11-12 14:09 ` Josef Bacik
  2018-11-12 18:28 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: Nikolay Borisov @ 2018-11-12 10:26 UTC (permalink / raw)
  To: fdmanana, linux-btrfs



On 12.11.18 г. 12:24 ч., fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx
  2018-11-12 10:24 [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx fdmanana
  2018-11-12 10:26 ` Nikolay Borisov
@ 2018-11-12 14:09 ` Josef Bacik
  2018-11-12 18:28 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: Josef Bacik @ 2018-11-12 14:09 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Mon, Nov 12, 2018 at 10:24:30AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx
  2018-11-12 10:24 [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx fdmanana
  2018-11-12 10:26 ` Nikolay Borisov
  2018-11-12 14:09 ` Josef Bacik
@ 2018-11-12 18:28 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2018-11-12 18:28 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Mon, Nov 12, 2018 at 10:24:30AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-12 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 10:24 [PATCH] Btrfs: remove no longer used io_err from btrfs_log_ctx fdmanana
2018-11-12 10:26 ` Nikolay Borisov
2018-11-12 14:09 ` Josef Bacik
2018-11-12 18:28 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.