linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthias Matiak <netzpython@mail-on.us>
Subject: Re: [PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one
Date: Sat, 10 Dec 2011 13:40:53 +0900	[thread overview]
Message-ID: <CAKYAXd9jYMZMht02n=W4T8+hq8hU8owoZk07TbLb-myk52PNKw@mail.gmail.com> (raw)
In-Reply-To: <1323483097-24210-1-git-send-email-jack@suse.cz>

2011/12/10 Jan Kara <jack@suse.cz>:
> During BKL removal, conversion of files from in-ICB format to normal format got
> broken. We call ->writepage with i_data_sem held but udf_get_block() also
> acquires i_data_sem thus creating A-A deadlock.
>
> We fix the problem by dropping i_data_sem before calling ->writepage() which is
> safe since i_mutex still protects us against any changes in the file. Also fix
> pagelock - i_data_sem lock inversion in udf_expand_file_adinicb() by dropping
> i_data_sem before calling find_or_create_page().
>
> Reported-by: Matthias Matiak <netzpython@mail-on.us>
> Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
> ---
>  fs/udf/file.c  |    6 +++---
>  fs/udf/inode.c |   20 +++++++++++++++++---
>  2 files changed, 20 insertions(+), 6 deletions(-)
>
>  I plan to merge this fix through my tree soon.
>
> +/*
> + * Expand file stored in ICB to a normal one-block-file
> + *
> + * This function requires i_data_sem for writing and releases it.
> + * This function requires i_mutex held
> + */
>  int udf_expand_file_adinicb(struct inode *inode)
>  {
>        struct page *page;
> @@ -171,6 +177,11 @@ int udf_expand_file_adinicb(struct inode *inode)
>                mark_inode_dirty(inode);
                  up_write(&iinfo->i_data_sem);
Hi Jan.
I do not know if that helps, Would it need here ?
Thanks.
>                return 0;
>        }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-12-10  4:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10  2:11 [PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one Jan Kara
2011-12-10  4:40 ` Namjae Jeon [this message]
2011-12-12 14:22   ` Jan Kara

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='CAKYAXd9jYMZMht02n=W4T8+hq8hU8owoZk07TbLb-myk52PNKw@mail.gmail.com' \
    --to=linkinjeon@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netzpython@mail-on.us \
    /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).