All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Shishkin <edward.shishkin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: ReiserFS Mailing List <reiserfs-devel@vger.kernel.org>
Subject: [patch] reiser4: fix handling ENOSPC cryptcompress
Date: Fri, 25 Apr 2008 22:17:40 +0400	[thread overview]
Message-ID: <48122044.9000509@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Andrew, these bugs were caught when testing
reiser4 on a small partition. Please, apply.

Thanks,
Edward.

[-- Attachment #2: reiser4-fix-handling-enospc-cryptcompress.patch --]
[-- Type: text/x-patch, Size: 984 bytes --]

Problem:
Processes fall into infinite loop
when running in no-space-left-on-device situation.

Fixup:
Fixed leak of checkin_mutex in do_write_cryptcompress();
---
 linux-2.6.25-mm1/fs/reiser4/plugin/file/cryptcompress.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.25-mm1/fs/reiser4/plugin/file/cryptcompress.c.orig
+++ linux-2.6.25-mm1/fs/reiser4/plugin/file/cryptcompress.c
@@ -2707,7 +2707,8 @@
 		if (result)
 			goto out;
 		if (cont->state == PSCHED_ASSIGNED_NEW)
-			goto out_no_release;
+			/* done_lh was called in write_pschedule_hook */
+			goto out_no_longterm_lock;
 
 		result = prepare_logical_cluster(inode, pos, count, &clust,
 						 LC_APPOV);
@@ -2779,9 +2780,9 @@
 	} while (count);
  out:
 	done_lh(&hint->lh);
-	mutex_unlock(&info->checkin_mutex);
 	save_file_hint(file, hint);
- out_no_release:
+ out_no_longterm_lock:
+	mutex_unlock(&info->checkin_mutex);
 	kfree(hint);
 	put_cluster_handle(&clust);
 	assert("edward-195",

                 reply	other threads:[~2008-04-25 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48122044.9000509@gmail.com \
    --to=edward.shishkin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=reiserfs-devel@vger.kernel.org \
    /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.