* [PATCH] Btrfs: overwrite existing csums when logging
@ 2012-12-21 21:02 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2012-12-21 21:02 UTC (permalink / raw)
To: linux-btrfs
Users were complaining about the warning in btrfs_log_parent_inode() because
we're returning -EEXIST. This warning is gone in another patch but it's
still making us commit a transaction when we don't have to. Basically
because we will log all csums in an ordered extent for an em we have the
chance of logging the same csums multiple times. Since it's not that big of
a deal just allow csums to be over written in logs and that way we are safe.
This gets rid of the EEXIST and we log like we normally would. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
---
fs/btrfs/file-item.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index bd38cef..93ddc2e 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -835,6 +835,13 @@ insert:
ret = btrfs_insert_empty_item(trans, root, path, &file_key,
ins_size);
path->leave_spinning = 0;
+
+ /*
+ * We can sometimes already have copied a csum into the log, that's ok
+ * just overwrite it.
+ */
+ if (root->objectid == BTRFS_TREE_LOG_OBJECTID && ret == -EEXIST)
+ ret = 0;
if (ret < 0)
goto fail_unlock;
if (ret != 0) {
--
1.7.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-12-21 20:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-21 21:02 [PATCH] Btrfs: overwrite existing csums when logging Josef Bacik
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).