linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitri Monakhov <dmonakhov@openvz.org>
To: Theodore Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext3/4: Clear pagep after write_begin() has failed
Date: Tue, 24 Feb 2009 13:11:33 +0300	[thread overview]
Message-ID: <m3prh8w3e2.fsf@openvz.org> (raw)
In-Reply-To: <20090223031230.GA19739@mit.edu> (Theodore Tso's message of "Sun\, 22 Feb 2009 22\:12\:30 -0500")

Theodore Tso <tytso@mit.edu> writes:

> On Tue, Feb 17, 2009 at 10:24:19PM +0300, Dmitri Monakhov wrote:
>> Seems there is no strict rule to for this case. In fact everybody
>> just ignored this variable after write_begin() has failed.
>> This was true until ext4_defrag_partial(). So let's follows simple
>> rule similar to block_write_begin().
>
> I've checked the latest ext4_defrag_partial, and it doesn't reference
> the page variable if write_begin() failed....
>
> 						- Ted
Latest posted defrag version 1.0 from 30 Jan, contains following code
+	up_write(&EXT4_I(org_inode)->i_data_sem);
+	ret = a_ops->write_begin(o_filp, mapping, offs, data_len, w_flags,
+								&page, &fsdata);
+	down_write(&EXT4_I(org_inode)->i_data_sem);
+
+	if (unlikely(ret < 0))
+		goto out;
.....
+out:
+	if (unlikely(page)) {
+		if (PageLocked(page))
+			unlock_page(page);
+		page_cache_release(page);
+	}
In fact the patch i'm propose is mostly a cleanup, rather then serious fix
for real issue. IMHO it is not bad idea to fold it in to some real patch.

      reply	other threads:[~2009-02-24 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 19:24 [PATCH] ext3/4: Clear pagep after write_begin() has failed Dmitri Monakhov
2009-02-23  3:12 ` Theodore Tso
2009-02-24 10:11   ` Dmitri Monakhov [this message]

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=m3prh8w3e2.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 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).