Re: [PATCH] Btrfs: fix wrong uevent target

2014-07-03 Thread Miao Xie
CC Anand Jain

Sorry, please ignore this patch.
Anand wrote the same patch several days ago, so this bug fix belongs to Anand
though he NACKed his patch at that time.

Thanks
Miao

On Wed, 2 Jul 2014 17:03:54 +0800, Miao Xie wrote:
 block_device's bd_disk points to the disk, not the object which block_device
 is actually corresponding to(the whole disk or a partition), so we would send
 uevent to the wrong target. Fix it.
 
 Signed-off-by: Miao Xie mi...@cn.fujitsu.com
 ---
  fs/btrfs/volumes.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
 index 95828b0..e8b9214 100644
 --- a/fs/btrfs/volumes.c
 +++ b/fs/btrfs/volumes.c
 @@ -123,7 +123,7 @@ static void btrfs_kobject_uevent(struct block_device 
 *bdev,
  {
   int ret;
  
 - ret = kobject_uevent(disk_to_dev(bdev-bd_disk)-kobj, action);
 + ret = kobject_uevent(part_to_dev(bdev-bd_part)-kobj, action);
   if (ret)
   pr_warn(BTRFS: Sending event '%d' to kobject: '%s' (%p): 
 failed\n,
   action,
 

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Btrfs: fix wrong uevent target

2014-07-03 Thread Chris Mason
On 07/03/2014 07:09 AM, Miao Xie wrote:
 CC Anand Jain
 
 Sorry, please ignore this patch.
 Anand wrote the same patch several days ago, so this bug fix belongs to Anand
 though he NACKed his patch at that time.

It certainly looks right, but Anand had mentioned that he had a few
questions on testing.  I've pulled it out for now, but I'll take Anand's
version when you're both happy.

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Btrfs: fix wrong uevent target

2014-07-03 Thread Anand Jain

Chris,

  This fix is theoretically correct but my guess that this would
  solve problem as reported by Qu Wenruo was wrong [1].
  Patch is good to integrate.

Thanks, Anand

[1] Re: [PATCH RFC] btrfs: Add ctime/mtime update for btrfs device 
add/remove.



On 03/07/2014 22:00, Chris Mason wrote:

On 07/03/2014 07:09 AM, Miao Xie wrote:

CC Anand Jain

Sorry, please ignore this patch.
Anand wrote the same patch several days ago, so this bug fix belongs to Anand
though he NACKed his patch at that time.


It certainly looks right, but Anand had mentioned that he had a few
questions on testing.  I've pulled it out for now, but I'll take Anand's
version when you're both happy.

-chris

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Btrfs: fix wrong uevent target

2014-07-03 Thread Qu Wenruo


 Original Message 
Subject: Re: [PATCH] Btrfs: fix wrong uevent target
From: Anand Jain anand.j...@oracle.com
To: Chris Mason c...@fb.com
Date: 2014年07月04日 01:32

Chris,

  This fix is theoretically correct but my guess that this would
  solve problem as reported by Qu Wenruo was wrong [1].
  Patch is good to integrate.

Thanks, Anand

[1] Re: [PATCH RFC] btrfs: Add ctime/mtime update for btrfs device 
add/remove.
Yes, whatever uevent improvement will not solve the problem of 'btrfs 
dev scan; btrfs dev del; btrfs dev scan'.
Since uevent event is send from kernel and received by ueventd, then 
ueventd goes to update the device file ctime/mtine.
The uevent procedure is always asynchronized, so it will not fix the 
'btrfs dev scan' libblkid cache problem.


Althogh my RFC patch is ugly, it will provide a synchronzied method to 
update ctime/mtime from kernel.


Thank,
Qu



On 03/07/2014 22:00, Chris Mason wrote:

On 07/03/2014 07:09 AM, Miao Xie wrote:

CC Anand Jain

Sorry, please ignore this patch.
Anand wrote the same patch several days ago, so this bug fix belongs 
to Anand

though he NACKed his patch at that time.


It certainly looks right, but Anand had mentioned that he had a few
questions on testing.  I've pulled it out for now, but I'll take Anand's
version when you're both happy.

-chris

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Btrfs: fix wrong uevent target

2014-07-02 Thread Miao Xie
block_device's bd_disk points to the disk, not the object which block_device
is actually corresponding to(the whole disk or a partition), so we would send
uevent to the wrong target. Fix it.

Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 95828b0..e8b9214 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -123,7 +123,7 @@ static void btrfs_kobject_uevent(struct block_device *bdev,
 {
int ret;
 
-   ret = kobject_uevent(disk_to_dev(bdev-bd_disk)-kobj, action);
+   ret = kobject_uevent(part_to_dev(bdev-bd_part)-kobj, action);
if (ret)
pr_warn(BTRFS: Sending event '%d' to kobject: '%s' (%p): 
failed\n,
action,
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html