From: Idan Kedar Subject: [PATCH] exofs: fix hang on error path Date: Sun, 25 Nov 2012 19:44:16 +0200 Message-ID: <1353865456-25547-1-git-send-email-idank@tonian.com> Cc: idank@tonian.com, linux-fsdevel@vger.kernel.org, osd-dev@open-osd.org, solo@tonian.com, bhalevy@tonian.com, ilya@tonian.com To: bharrosh@panasas.com Return-path: Received: from mail-ea0-f174.google.com ([209.85.215.174]:48265 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753235Ab2KYRob (ORCPT ); Sun, 25 Nov 2012 12:44:31 -0500 Received: by mail-ea0-f174.google.com with SMTP id e13so4127292eaa.19 for ; Sun, 25 Nov 2012 09:44:30 -0800 (PST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: if ore_write() fails, we would unlock the pages of pcol, which is now empty, rather than pcol_copy which owns the pages when ore_write() is called. this means that no pages will actually be unlocked (pcol.nr_pages == 0) and the writing process (more accurately, the syncing process) will hang waiting for a writeback notification that never comes. Signed-off-by: Idan Kedar --- fs/exofs/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index b561810..bc5f1fe 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c @@ -676,7 +676,7 @@ static int write_exec(struct page_collect *pcol) return 0; err: - _unlock_pcol_pages(pcol, ret, WRITE); + _unlock_pcol_pages(pcol->pages ? pcol : pcol_copy, ret, WRITE); pcol_free(pcol); kfree(pcol_copy); -- 1.7.6.5