LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tao Ma <tm@tao.ma>
To: Milan Broz <mbroz@redhat.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] loop: clear read-only flag in loop_clr_fd.
Date: Sun, 13 Feb 2011 23:05:59 +0800	[thread overview]
Message-ID: <4D57F357.6060708@tao.ma> (raw)
In-Reply-To: <4D57E67E.1030707@redhat.com>

On 02/13/2011 10:11 PM, Milan Broz wrote:
> On 02/13/2011 11:58 AM, Tao Ma wrote:
>    
>> From: Tao Ma<boyu.mt@taobao.com>
>>
>> In 75f1dc0, we check bdev_read_only() from blkdev_get().
>> But the loop_clr_fd doesn't clear the read only flag.
>> What cause a error if we changing a loop device from
>> read only to writable.
>>      
> No, sorry, this is not proper/complete fix. It fixes it for loop
> (and even not completely - you are missing some error
> paths and ignoring autoclear mode where you have bdev NULL.)
> (And yes, I tried the same as workaround.)
>    
aha, sorry, I don't know you are more familiar with loop than me. ;)
I just did a quick test and sent the patch. So could you please tell me
a little more about how we use autoclear mode? I just googled but can't
find some helpful information. I will try to update my patch with a V2 when
I get familiar with the whole stuff.
> And it will not help for DM case (and possibly others).
>    
Actually I don't think it is Tejun's patch that causes the bug. What his 
patch do
is to expose some bugs that already exist.  Say loop, it sets ro when it 
get read
only flags, but doesn't clear it when it is detached. It should be 
loop's problem,
not blkdev's. As for the DM case, I guess it should also be related to 
DM part.

Regards,
Tao

  reply	other threads:[~2011-02-13 15:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  2:02 block device read-only handling regression in 2.6.38-rc4 (bisected) Milan Broz
2011-02-13 10:58 ` [PATCH] loop: clear read-only flag in loop_clr_fd Tao Ma
2011-02-13 14:11   ` Milan Broz
2011-02-13 15:05     ` Tao Ma [this message]
2011-02-13 16:44       ` Milan Broz
2011-02-14 10:30         ` Tejun Heo
2011-02-14 11:47           ` Milan Broz
2011-02-14 13:14             ` [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings Milan Broz
2011-02-14 14:09               ` Tejun Heo
2011-02-14 14:23                 ` Milan Broz
2011-02-14 15:44                   ` Tejun Heo
2011-02-14 23:15                     ` NeilBrown
2011-02-15  2:03                       ` [dm-devel] " Alasdair G Kergon
2011-02-15 12:17                         ` Milan Broz
2011-02-15 12:46                           ` Alasdair G Kergon
2011-02-15 15:20                             ` Tejun Heo
2011-02-15 15:46                               ` Alasdair G Kergon
2011-02-15 15:50                                 ` Tejun Heo
2011-02-15 16:05                                   ` Milan Broz
2011-02-15 16:12                                     ` Tejun Heo
2011-02-15 16:36                                       ` Milan Broz
2011-02-15 16:41                                         ` Tejun Heo
2011-02-15 16:56                                           ` Alasdair G Kergon
2011-02-16  8:46                                             ` Tejun Heo
2011-02-15 16:58                                           ` Milan Broz
2011-02-16  8:39                                             ` Tejun Heo
2011-02-15 15:16                           ` [PATCH] Return EROFS if read-only detected on block device Milan Broz
2011-02-14 14:39                 ` [dm-devel] [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings Alasdair G Kergon
2011-02-14 14:07             ` [PATCH] loop: clear read-only flag in loop_clr_fd Tejun Heo
     [not found] <glzzr-4Jt-1@gated-at.bofh.it>
     [not found] ` <glHQm-1vQ-25@gated-at.bofh.it>
2011-02-13 20:41   ` Bodo Eggert

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=4D57F357.6060708@tao.ma \
    --to=tm@tao.ma \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    --cc=tj@kernel.org \
    --subject='Re: [PATCH] loop: clear read-only flag in loop_clr_fd.' \
    /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

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).