All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: mfasheh@versity.com, akpm@linux-foundation.org,
	jlbec@evilplan.org, darrick.wong@oracle.com
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	ocfs2-devel@oss.oracle.com
Subject: [PATCH 08/11] ocfs2: always unlock when completing dio writes
Date: Sat, 10 Dec 2016 12:43:47 -0800	[thread overview]
Message-ID: <148140262754.24628.5961067465838150776.stgit@birch.djwong.org> (raw)
In-Reply-To: <148140257493.24628.6724911560073347399.stgit@birch.djwong.org>

Always unlock the inode when completing dio writes, even if an error
has occurrred.  The caller already checks the inode and unlocks it
if needed, so we might as well reduce contention.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ocfs2/aops.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 136a49c..3c531f1 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2392,13 +2392,10 @@ static int ocfs2_dio_end_io(struct kiocb *iocb,
 	int level;
 	int ret = 0;
 
-	if (bytes <= 0)
-		return 0;
-
 	/* this io's submitter should not have unlocked this before we could */
 	BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));
 
-	if (private)
+	if (bytes > 0 && private)
 		ret = ocfs2_dio_end_io_write(inode, private, offset, bytes);
 
 	ocfs2_iocb_clear_rw_locked(iocb);


WARNING: multiple messages have this Message-ID (diff)
From: Darrick J. Wong <darrick.wong@oracle.com>
To: mfasheh@versity.com, akpm@linux-foundation.org,
	jlbec@evilplan.org, darrick.wong@oracle.com
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 08/11] ocfs2: always unlock when completing dio writes
Date: Sat, 10 Dec 2016 12:43:47 -0800	[thread overview]
Message-ID: <148140262754.24628.5961067465838150776.stgit@birch.djwong.org> (raw)
In-Reply-To: <148140257493.24628.6724911560073347399.stgit@birch.djwong.org>

Always unlock the inode when completing dio writes, even if an error
has occurrred.  The caller already checks the inode and unlocks it
if needed, so we might as well reduce contention.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ocfs2/aops.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 136a49c..3c531f1 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2392,13 +2392,10 @@ static int ocfs2_dio_end_io(struct kiocb *iocb,
 	int level;
 	int ret = 0;
 
-	if (bytes <= 0)
-		return 0;
-
 	/* this io's submitter should not have unlocked this before we could */
 	BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));
 
-	if (private)
+	if (bytes > 0 && private)
 		ret = ocfs2_dio_end_io_write(inode, private, offset, bytes);
 
 	ocfs2_iocb_clear_rw_locked(iocb);

  parent reply	other threads:[~2016-12-10 20:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-10 20:42 [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Darrick J. Wong
2016-12-10 20:42 ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Darrick J. Wong
2016-12-10 20:43 ` [PATCH 01/11] fs: try to clone files first in vfs_copy_file_range Christoph Hellwig
2016-12-10 20:43   ` [Ocfs2-devel] " Christoph Hellwig
2016-12-10 20:43 ` [PATCH 02/11] vfs: refactor clone/dedupe_file_range common functions Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 03/11] ocfs2: convert inode refcount test to a helper Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 04/11] ocfs2: add newlines to some error messages Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 05/11] ocfs2: prohibit refcounted swapfiles Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 06/11] ocfs2: budget for extent tree splits when adding refcount flag Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 07/11] ocfs2: don't eat io errors during _dio_end_io_write Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` Darrick J. Wong [this message]
2016-12-10 20:43   ` [Ocfs2-devel] [PATCH 08/11] ocfs2: always unlock when completing dio writes Darrick J. Wong
2016-12-10 20:43 ` [PATCH 09/11] ocfs2: fix bad pointer cast Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:44 ` [PATCH 10/11] ocfs2: charge quota for reflinked blocks Darrick J. Wong
2016-12-10 20:44   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:44 ` [PATCH 11/11] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features Darrick J. Wong
2016-12-10 20:44   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 23:43 ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Al Viro
2016-12-10 23:43   ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Al Viro
2016-12-10 23:46   ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Al Viro
2016-12-10 23:46     ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Al Viro
2016-12-11 22:03     ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Darrick J. Wong
2016-12-11 22:03       ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148140262754.24628.5961067465838150776.stgit@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jlbec@evilplan.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@versity.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.