diff mbox

Btrfs: move finish_wait out of the loop

Message ID 20170901221430.10131-3-bo.li.liu@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu Bo Sept. 1, 2017, 10:14 p.m. UTC
If we're still going to wait after schedule(), we don't have to do
finish_wait() to remove our %wait_queue_entry since prepare_to_wait()
won't add the same %wait_queue_entry twice.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba Sept. 6, 2017, 12:55 p.m. UTC | #1
On Fri, Sep 01, 2017 at 04:14:28PM -0600, Liu Bo wrote:
> If we're still going to wait after schedule(), we don't have to do
> finish_wait() to remove our %wait_queue_entry since prepare_to_wait()
> won't add the same %wait_queue_entry twice.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index fa1b78c..19e4dec 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -651,8 +651,8 @@  static void btrfs_wait_for_no_snapshoting_writes(struct btrfs_root *root)
 		if (writers)
 			schedule();
 
-		finish_wait(&root->subv_writers->wait, &wait);
 	} while (writers);
+	finish_wait(&root->subv_writers->wait, &wait);
 }
 
 static int create_snapshot(struct btrfs_root *root, struct inode *dir,