All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/7] KVM: Write protect the updated slot only when we start dirty logging
From: Takuya Yoshikawa @ 2012-12-25  4:08 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: mtosatti, kvm, linux-kernel
In-Reply-To: <20121224132717.GW17584@redhat.com>

On Mon, 24 Dec 2012 15:27:17 +0200
Gleb Natapov <gleb@redhat.com> wrote:

> > @@ -6897,7 +6897,14 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> >  	spin_lock(&kvm->mmu_lock);
> >  	if (nr_mmu_pages)
> >  		kvm_mmu_change_mmu_pages(kvm, nr_mmu_pages);
> > -	kvm_mmu_slot_remove_write_access(kvm, mem->slot);
> > +	/*
> > +	 * Write protect all pages for dirty logging.
> > +	 * Existing largepage mappings are destroyed here and new ones will
> > +	 * not be created until the end of the logging.
> > +	 */
> > +	if ((mem->flags & KVM_MEM_LOG_DIRTY_PAGES) &&
> > +	    !(old.flags & KVM_MEM_LOG_DIRTY_PAGES))
> > +		kvm_mmu_slot_remove_write_access(kvm, mem->slot);
> We should not check old slot flags here or at least check that
> old.npages is not zero. Userspace may delete a slot using old flags,
> then, if new memslot is created with dirty log enabled, it will not be
> protected.

The flag, KVM_MEM_LOG_DIRTY_PAGES, is explicitely cleared when we
delete a slot to free dirty_bitmap:

	if (!npages)
		mem->flags &= ~KVM_MEM_LOG_DIRTY_PAGES;

So when old.npages is not zero, the second condition must be true.

Other parts are doing "if (!slot->dirty_bitmap)" to see if the slot
is in dirty logging mode.  If you prefer, we can do the same here.

Thanks,
	Takuya

^ permalink raw reply

* Re: [PATCH v7 06/27] x86, 64bit: early #PF handler set page table
From: Yinghai Lu @ 2012-12-25  4:04 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Jason Wessel, Jan Kiszka, Thomas Gleixner, Ingo Molnar,
	Eric W. Biederman, Andrew Morton, linux-kernel
In-Reply-To: <50D8F054.20404@zytor.com>

On Mon, Dec 24, 2012 at 4:16 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 12/20/2012 08:56 AM, Yinghai Lu wrote:
>>>
>>>
>>> So in that case, kgdb is broken and will need to be fixed up.  That
>>> happens all the time with debugging tools.
>>
>>
>> If there is a way that we can make all parties happy, we really should
>> not break KGDB.
>>
>> Please reconsider to stop #PF handler in x86_64_start_kernel. in that case
>> 1. microcode update still can use #PF handler to find microcode in
>> ramdisk and use it.
>> 2. kernel that is loaded above 4G, could set mapping in C instead of
>> set that in head_64.S
>>     and use ioremap to access zero_page
>> 3. KGDB still can call early_trap_init early before init_mem_mapping.
>>
>
> Yinghai, this is total and utter bullshit.
>
> We should *fix* kgdb, not pave around it.  I refuse to have kgdb be yet
> another Xen turning random kernel internals into ABIs.

well, I updated for-x86-boot-v7 that stop #PF handler after init_mem_mapping.

it has fix for AMD system aka reverting far jmp to ret.

Yinghai

^ permalink raw reply

* [PATCH 4/4] sh: ecovec: add sample amixer settings
From: Kuninori Morimoto @ 2012-12-25  4:04 UTC (permalink / raw)
  To: linux-sh

FSI - DA7210 needs amixer settings to use it.
This patch adds quick setting guide

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/sh/boards/mach-ecovec24/setup.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 64559e8a..b20a14e 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -70,6 +70,16 @@
  *                                  OFF-ON : MMC
  */
 
+/*
+ * FSI - DA7210
+ *
+ * it needs amixer settings for playing
+ *
+ * amixer set 'HeadPhone' 80
+ * amixer set 'Out Mixer Left DAC Left' on
+ * amixer set 'Out Mixer Right DAC Right' on
+ */
+
 /* Heartbeat */
 static unsigned char led_pos[] = { 0, 1, 2, 3 };
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 3/4] ARM: shmobile: add sample amixer settings for armadillo800eva
From: Kuninori Morimoto @ 2012-12-25  4:04 UTC (permalink / raw)
  To: linux-sh

wm8978 codec requires amixer settings for capture.
This patch adds sample amixer settings on comment area.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 5353adf..5f179e1 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -124,6 +124,14 @@
  * this command is required when playback.
  *
  * # amixer set "Headphone" 50
+ *
+ * this command is required when capture.
+ *
+ * # amixer set "Input PGA" 15
+ * # amixer set "Left Input Mixer MicP" on
+ * # amixer set "Left Input Mixer MicN" on
+ * # amixer set "Right Input Mixer MicN" on
+ * # amixer set "Right Input Mixer MicP" on
  */
 
 /*
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 2/4] ARM: shmobile: add sample amixer settings for ap4evb
From: Kuninori Morimoto @ 2012-12-25  4:03 UTC (permalink / raw)
  To: linux-sh

FSI2A-AK4643 needs amixer setting to use it.
This patch adds quick setting guide

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-ap4evb.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 4065785..1a87d58 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -143,6 +143,10 @@
  *
  * SW41	:  ON : SH-Mobile AP4 Audio Mode
  *	: OFF : Bluetooth Audio Mode
+ *
+ * it needs amixer settings for playing
+ *
+ * amixer set "Headphone Enable" on
  */
 
 /*
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/4] ARM: shmobile: fix sample amixer settings for mackerel
From: Kuninori Morimoto @ 2012-12-25  4:03 UTC (permalink / raw)
  To: linux-sh

This patch updates FSI-AK4643 amixer setting

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-mackerel.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 3f56e70..e10ac06 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -202,9 +202,7 @@
  *
  * it needs amixer settings for playing
  *
- * amixer set "Headphone" on
- * amixer set "HPOUTL Mixer DACH" on
- * amixer set "HPOUTR Mixer DACH" on
+ * amixer set "Headphone Enable" on
  */
 
 /* Fixed 3.3V and 1.8V regulators to be used by multiple devices */
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 0/4] ARM/sh: add sample amixer settings for FSI-codec
From: Kuninori Morimoto @ 2012-12-25  4:03 UTC (permalink / raw)
  To: linux-sh


Hi Simon, Paul

These patches add sample amixer settings for sound on comment area.
Sound doesn't work without these puzzling settings

Kuninori Morimoto (4):
      ARM: shmobile: fix sample amixer settings for mackerel
      ARM: shmobile: add sample amixer settings for ap4evb
      ARM: shmobile: add sample amixer settings for armadillo800eva
      sh: ecovec: add sample amixer settings

 arch/arm/mach-shmobile/board-ap4evb.c          |    4 ++++
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 ++++++++
 arch/arm/mach-shmobile/board-mackerel.c        |    4 +---
 arch/sh/boards/mach-ecovec24/setup.c           |   10 ++++++++++
 4 files changed, 23 insertions(+), 3 deletions(-)

^ permalink raw reply

* [Buildroot] [RFC] How to handle targets that need more than one file system to boot?
From: Steve Calfee @ 2012-12-25  3:52 UTC (permalink / raw)
  To: buildroot
In-Reply-To: <201212240100.17473.yann.morin.1998@free.fr>

On Sun, Dec 23, 2012 at 4:00 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Hello All!
>
> Some systems require a specific partition layout to be able to boot.
> For example:
>   - the RaspberryPi:
>     - the first, primary partition, and vfat-formatted, with the bootloader
>       files and the kernel
>     - the rest of the filesystem hierarchy can be dispatched at will
>   - on i.MX:
>     - the first, (primary?) partition must be non-FAT (special type?), with
>       the bootloader raw-binary inside
>     - the rest of the filesystem hierarchy can be whatever
>   - on OMAP paltforms:
>     - similar to the PI, but the kernel can be on ext2/3/4 (as wel as VFAT?)
>
> For now, buildroot can build a single filesystem image. This is not useable
> for these systems. The only possibility as of today is to configure BR to
> generate a tarball, and have a custom script that does the required split up
> of the different components.
>
> It would be nice to have buildroot smoothly handle these cases.
>
> After a quick talk on IRC with Thomas, here are a few proposals.
>
> 0) Keep as-is
>
> Buildroot can not handle all possibilities, we can't even *think* about
> all such possibilities. This is the easiest for buildroot, and pushes the
> complexity down to the users.
>
This is my favorite. There are no known situations that cannot be
handled by buildroot. Quit adding to the makefile. It adds
complexities, and only fixes the one, current users complaint. Keep
mechanism separate from policy. Buildroot should be a simple
consistent way to build a root file system. People who have weird
build/target desires can do that in an external script.

Regards, Steve

^ permalink raw reply

* Re: [PATCH 10/25] kprobes: fix wait_for_kprobe_optimizer()
From: Masami Hiramatsu @ 2012-12-25  3:51 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel, Ananth N Mavinakayanahalli, Anil S Keshavamurthy,
	David S. Miller, yrl.pp-manager.tt@hitachi.com
In-Reply-To: <1356141435-17340-11-git-send-email-tj@kernel.org>

(2012/12/22 10:57), Tejun Heo wrote:
> wait_for_kprobe_optimizer() seems largely broken.  It uses
> optimizer_comp which is never re-initialized, so
> wait_for_kprobe_optimizer() will never wait for anything once
> kprobe_optimizer() finishes all pending jobs for the first time.

Thank you for fixing that!
I must misunderstand that the DECLARE_COMPLETION() macro.

> Also, aside from completion, delayed_work_pending() is %false once
> kprobe_optimizer() starts execution and wait_for_kprobe_optimizer()
> won't wait for it.
>
> Reimplement it so that it flushes optimizing_work until
> [un]optimizing_lists are empty.  Note that this also makes
> optimizing_work execute immediately if someone's waiting for it, which
> is the nicer behavior.

I think your enhancement is reasonable and GOOD for me.

Thanks again!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>


> 
> Only compile tested.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> Please let me know how this patch should be routed.  I can take it
> through the workqueue tree if necessary.
> 
> Thanks.
> 
>  kernel/kprobes.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 098f396..f230e81 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -471,7 +471,6 @@ static LIST_HEAD(unoptimizing_list);
>  
>  static void kprobe_optimizer(struct work_struct *work);
>  static DECLARE_DELAYED_WORK(optimizing_work, kprobe_optimizer);
> -static DECLARE_COMPLETION(optimizer_comp);
>  #define OPTIMIZE_DELAY 5
>  
>  /*
> @@ -552,8 +551,7 @@ static __kprobes void do_free_cleaned_kprobes(struct list_head *free_list)
>  /* Start optimizer after OPTIMIZE_DELAY passed */
>  static __kprobes void kick_kprobe_optimizer(void)
>  {
> -	if (!delayed_work_pending(&optimizing_work))
> -		schedule_delayed_work(&optimizing_work, OPTIMIZE_DELAY);
> +	schedule_delayed_work(&optimizing_work, OPTIMIZE_DELAY);
>  }
>  
>  /* Kprobe jump optimizer */
> @@ -592,16 +590,25 @@ static __kprobes void kprobe_optimizer(struct work_struct *work)
>  	/* Step 5: Kick optimizer again if needed */
>  	if (!list_empty(&optimizing_list) || !list_empty(&unoptimizing_list))
>  		kick_kprobe_optimizer();
> -	else
> -		/* Wake up all waiters */
> -		complete_all(&optimizer_comp);
>  }
>  
>  /* Wait for completing optimization and unoptimization */
>  static __kprobes void wait_for_kprobe_optimizer(void)
>  {
> -	if (delayed_work_pending(&optimizing_work))
> -		wait_for_completion(&optimizer_comp);
> +	mutex_lock(&kprobe_mutex);
> +
> +	while (!list_empty(&optimizing_list) || !list_empty(&unoptimizing_list)) {
> +		mutex_unlock(&kprobe_mutex);
> +
> +		/* this will also make optimizing_work execute immmediately */
> +		flush_delayed_work(&optimizing_work);
> +		/* @optimizing_work might not have been queued yet, relax */
> +		cpu_relax();
> +
> +		mutex_lock(&kprobe_mutex);
> +	}
> +
> +	mutex_unlock(&kprobe_mutex);
>  }
>  
>  /* Optimize kprobe if p is ready to be optimized */
> 


-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply

* [PATCH] sched: Fix print format for u64
From: Fabio Estevam @ 2012-12-25  2:28 UTC (permalink / raw)
  To: mingo; +Cc: peterz, pjt, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

commit c566e8e9 (sched: Aggregate total task_group load) introduced the 
following build warning:

kernel/sched/debug.c:225:2: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'u64' [-Wformat]
kernel/sched/debug.c:225:2: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'u64' [-Wformat]

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 kernel/sched/debug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 2cd3c1b..83ec463 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -222,7 +222,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 			cfs_rq->runnable_load_avg);
 	SEQ_printf(m, "  .%-30s: %lld\n", "blocked_load_avg",
 			cfs_rq->blocked_load_avg);
-	SEQ_printf(m, "  .%-30s: %ld\n", "tg_load_avg",
+	SEQ_printf(m, "  .%-30s: %lld\n", "tg_load_avg",
 			atomic64_read(&cfs_rq->tg->load_avg));
 	SEQ_printf(m, "  .%-30s: %lld\n", "tg_load_contrib",
 			cfs_rq->tg_load_contrib);
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH 25/25] ipc: don't use [delayed_]work_pending()
From: Tejun Heo @ 2012-12-25  3:29 UTC (permalink / raw)
  To: Borislav Petkov, Andrew Morton, linux-kernel
In-Reply-To: <20121224194101.GC5344@liondog.tnic>

Hello,

On Mon, Dec 24, 2012 at 08:41:01PM +0100, Borislav Petkov wrote:
> On Mon, Dec 24, 2012 at 10:45:20AM -0800, Tejun Heo wrote:
> > I was confused a bit there. We can't. Nothing guarantees that the
> > queuer sees the cleared PENDING before the work item starts execution,
> > and I think ipc memory hotplug could also be broken from that.
> 
> Stupid question: why not clear PENDING after execution is done? I'm
> looking at process_one_work() here.

The behavior is primarily because we want to enable workqueue users to
guarantee that a full work item execution happens at least once after
certain event happens.  ie. Let's say there's a work item which
processes data generated by a device.  If it's IRQ handler calls
queue_work() after getting notified of new data segment by the device,
it would want to guarantee that whole work item execution would happen
afterwards.  If you clear PENDING after execution, the event may
overlap with the end of the previous execution and the new data won't
be processed.

> > It's highly unlikely to actually happen and there may be external
> > locking which prevents the race from actually happening, but there's
> > nothing synchronizing queueing and the execution of the work item.
> > Looking at that part of code only, it's possible that it fails to
> > queue the work item after a memory hotplug event even though the
> > previous queueing already started execution and processed a couple
> > notifiers.
> 
> Maybe failure to queue could be signalled with a proper return value
> from __queue_work()?

It already does that but it's not about the return value.  You simply
cannot know whether to proceed with queueing or not with test_bit()
alone.

> Btw, I'm afraid I don't understand the "memory hotplug event" aspect and
> how that can influence the queueing - all it does it is list_add_tail,
> basically.

It doesn't have anything to do with memory hotplug event itself.  It's
a generic memory access ordering / synchronization issue.  There just
isn't anything preventing test_bit() from seeing PENDING bit from
before clearing.

Thanks.

-- 
tejun

^ permalink raw reply

* Regression in kernel 3.8-rc1 bisected to commit adfa79d: I now get many "unable to enumerate USB device" messages
From: Larry Finger @ 2012-12-25  3:16 UTC (permalink / raw)
  To: Alan Stern; +Cc: LKML, linux-usb

The problem has been bisected to commit adfa79d entitled "USB: EHCI: make 
ehci-pci a separate driver". The symptom is that my NVIDIA controller again 
reverts to unended logging of messages of the form "hub 2-0:1.0: unable to 
enumerate USB device on port 5".

This behavior was previously fixed with commit c618759.

Thanks,

Larry

^ permalink raw reply

* Re: [PATCH 25/25] ipc: don't use [delayed_]work_pending()
From: Tejun Heo @ 2012-12-25  3:18 UTC (permalink / raw)
  To: Borislav Petkov, Andrew Morton, linux-kernel
In-Reply-To: <20121224193258.GB5344@liondog.tnic>

Hello, Borislav.

On Mon, Dec 24, 2012 at 08:32:58PM +0100, Borislav Petkov wrote:
> Ok, understood. I have only one question: how do you make sure
> schedule_work() is used only in cold paths?

Hot and cold are relative terms and unless someone is doing things
like invoking queue_work() from high-frequency interrupt handler, the
level of overhead from queue_work() isn't likely to matter.  The best
way to deal with such hot paths would differ depending on the
specifics of each hot path - ie. bouncing to workqueue from IRQ
handler would be better handled by threaded IRQ handlers.

At this point, especially given how all of work_pending() users are
way too cold for any of this to matter, I don't think we need to worry
about this.

> Btw, there's __cancel_delayed_work() which is not used anywhere and it
> could be deleted AFAICT.

Yeah, there are several interfaces which are being deprecated.
They'll be gone in a few cycles.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: Problem with cephx in 0.55
From: Maciej Gałkiewicz @ 2012-12-25  3:06 UTC (permalink / raw)
  To: Michael Morgan; +Cc: ceph-devel
In-Reply-To: <CAGqxmDPp7ELLdfdWD2iQCp=Bc8Xbvngn3r0yV2yeGpo5pdy_nA@mail.gmail.com>

On 12 December 2012 23:20, Maciej Gałkiewicz
<maciejgalkiewicz@ragnarson.com> wrote:
>>  Try removing the "=" from the osd cap, ie.
>
> Already tried and it did not help.

I have found two tickets probably related to this issue:
http://tracker.newdream.net/issues/3226
http://tracker.newdream.net/issues/3228

I was thinking that maybe following change is responsible for my problem:
http://tracker.newdream.net/projects/ceph/repository/revisions/303f640ce561c22a85a16b49585a22115273f790/diff/src/osd/OSDCap.cc

I achieved something really weird for me. I can map rbd volume with
exactly the same command on one VM but not on the other:

VM1# cat /tmp/secret
AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
VM2# rbd map postgresql --pool winnie-test --id winnie-test --keyfile
/tmp/secret
add failed: (1) Operation not permitted

VM2# cat /tmp/secret
AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
VM2# rbd map postgresql --pool winnie-test --id winnie-test --keyfile
/tmp/secret
VM2# rbd showmapped
id      pool    image   snap    device
0       cephx   vol     -       /dev/rbd0
1       winnie-test     redis   -       /dev/rbd1
2       winnie-test     test    -       /dev/rbd2
3       winnie-test     mongodb -       /dev/rbd3
4       winnie-test     postgresql      -       /dev/rbd4

Of course ceph.conf looks exactly the same on both machines. Caps
configured just like in manual
(https://github.com/ceph/ceph/commit/7ea8f16e225d3b164828e5d25b262b3eb156a165).
MON# ceph auth list
...
client.winnie-test
        key: AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
        caps: [mon] allow r
        caps: [osd] allow pool winnie-test rwx

On VM2 I have mapped volume redis when caps looked like this:
client.winnie-test
        key: AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
        caps: [mon] allow r
        caps: [osd] allow rwx

and then changed them to those with pool limitation.

Is it possible that the pool is somehow broken? I managed to map
volumes from completely new pool created after the upgrade. It is not
enough for me because I still need to upgrade production cluster
without downtime.

Logs from monitor when mapping on VM2:
2012-12-25 03:55:08.262504 7fe0982d5700 10 mon.cc@0(leader).auth v2019
update_from_paxos()
2012-12-25 03:55:08.262513 7fe0982d5700 10 mon.cc@0(leader).auth v2019 auth
2012-12-25 03:55:08.262516 7fe0982d5700 10 cephx keyserver:
_check_rotating_secrets
2012-12-25 03:55:09.611592 7fe0963cb700  1 -- 10.255.128.1:6789/0 >>
:/0 pipe(0x26d9b00 sd=21 :6789 pgs=0 cs=0 l=0).accept sd=21
2012-12-25 03:55:09.611642 7fe0963cb700  0 -- 10.255.128.1:6789/0 >>
10.255.0.16:0/903309176 pipe(0x26d9b00 sd=21 :6789 pgs=0 cs=0
l=0).accept peer addr is really 10.25
5.0.16:0/903309176 (socket is 10.255.0.16:36850/0)
2012-12-25 03:55:09.611665 7fe0963cb700 10 mon.cc@0(leader) e2
ms_verify_authorizer 10.255.0.16:0/903309176 client protocol 0
2012-12-25 03:55:09.611674 7fe0963cb700 10 In get_auth_session_handler
for protocol 0
2012-12-25 03:55:09.611905 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
client.11617 10.255.0.16:0/903309176 1 ==== auth(proto 0 40 bytes
epoch 0) ==== 66+0+0 (3435522658
 0 0) 0x26db200 con 0x26f7a20
2012-12-25 03:55:09.611922 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:55:09.611928 7fe097ad4700 10 mon.cc@0(leader) e2 do not
have session, making new one
2012-12-25 03:55:09.611934 7fe097ad4700 10 mon.cc@0(leader) e2
ms_dispatch new session MonSession: client.11617
10.255.0.16:0/903309176 is open for client.11617 10.255.
0.16:0/903309176
2012-12-25 03:55:09.611942 7fe097ad4700 10 mon.cc@0(leader) e2 setting
timeout on session
2012-12-25 03:55:09.611946 7fe097ad4700 20 mon.cc@0(leader) e2  caps
2012-12-25 03:55:09.611958 7fe097ad4700 10 mon.cc@0(leader).auth v2019
update_from_paxos()
2012-12-25 03:55:09.611962 7fe097ad4700 10 mon.cc@0(leader).auth v2019
preprocess_query auth(proto 0 40 bytes epoch 0) from client.11617
10.255.0.16:0/903309176
2012-12-25 03:55:09.611968 7fe097ad4700 10 mon.cc@0(leader).auth v2019
prep_auth() blob_size=40
2012-12-25 03:55:09.611982 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.16:0/903309176 -- mon_map v1 -- ?+0 0x28001e0 con 0x26f7a20
2012-12-25 03:55:09.612021 7fe097ad4700 10 cephx server
client.winnie-test: start_session server_challenge 80a9fc35fd9f5d17
2012-12-25 03:55:09.612028 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.16:0/903309176 -- auth_reply(proto 2 0 Success) v1 -- ?+0
0x27d4a00 con 0x26f7a20
2012-12-25 03:55:09.612303 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
client.11617 10.255.0.16:0/903309176 2 ==== auth(proto 2 144 bytes
epoch 0) ==== 170+0+0 (29998387
98 0 0) 0x27d5200 con 0x26f7a20
2012-12-25 03:55:09.612318 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:55:09.612321 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: client.11617
10.255.0.16:0/903309176 is open for client.11617
10.255.0.16:0/903309176
2012-12-25 03:55:09.612330 7fe097ad4700 20 mon.cc@0(leader) e2  caps
2012-12-25 03:55:09.612340 7fe097ad4700 10 mon.cc@0(leader).auth v2019
update_from_paxos()
2012-12-25 03:55:09.612343 7fe097ad4700 10 mon.cc@0(leader).auth v2019
preprocess_query auth(proto 2 144 bytes epoch 0) from client.11617
10.255.0.16:0/903309176
2012-12-25 03:55:09.612349 7fe097ad4700 10 mon.cc@0(leader).auth v2019
prep_auth() blob_size=144
2012-12-25 03:55:09.612353 7fe097ad4700 10 cephx server
client.winnie-test: handle_request get_auth_session_key for
client.winnie-test
2012-12-25 03:55:09.612411 7fe097ad4700 20 cephx server
client.winnie-test:  checking key: req.key=1640729a9e305c31
expected_key=1640729a9e305c31
2012-12-25 03:55:09.612478 7fe097ad4700 10 cephx server
client.winnie-test: decoded old_ticket with global_id=11617
2012-12-25 03:55:09.612510 7fe097ad4700 10 cephx:
build_service_ticket_reply encoding 1 tickets with secret
AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
2012-12-25 03:55:09.612551 7fe097ad4700 10 cephx: build_service_ticket
service auth secret_id 134 ticket_info.ticket.name=client.winnie-test
2012-12-25 03:55:09.612606 7fe097ad4700 10 cephx keyserverdata:
get_caps: name=client.winnie-test
2012-12-25 03:55:09.612614 7fe097ad4700 10 cephx keyserverdata:
get_secret: num of caps=2
2012-12-25 03:55:09.612627 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.16:0/903309176 -- auth_reply(proto 2 0 Success) v1 -- ?+0
0x26db200 con 0x26f7a20
2012-12-25 03:55:09.612895 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
client.11617 10.255.0.16:0/903309176 3 ==== mon_subscribe({monmap=0+})
==== 31+0+0 (2650579135 0 0) 0x2740e00 con 0x26f7a20
2012-12-25 03:55:09.612911 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:55:09.612914 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: client.11617
10.255.0.16:0/903309176 is openallow r for client.11617
10.255.0.16:0/903309176
2012-12-25 03:55:09.612922 7fe097ad4700 20 mon.cc@0(leader) e2  caps allow r
2012-12-25 03:55:09.612925 7fe097ad4700 10 mon.cc@0(leader) e2
handle_subscribe mon_subscribe({monmap=0+})
2012-12-25 03:55:09.612933 7fe097ad4700 10 mon.cc@0(leader) e2
check_sub monmap next 0 have 2
2012-12-25 03:55:09.612940 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.16:0/903309176 -- mon_map v1 -- ?+0 0x28005a0 con 0x26f7a20
2012-12-25 03:55:09.612966 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
client.11617 10.255.0.16:0/903309176 -- mon_subscribe_ack(300s) v1 --
?+0 0x2704ea0
2012-12-25 03:55:11.906561 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
mds.0 10.255.128.1:6800/16937 7 ==== mdsbeacon(11597/cc up:active seq
1407 v168) v2 ==== 241+0+0 (4249480194 0 0) 0x26e3080 con 0x26f7080
2012-12-25 03:55:11.906586 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:55:11.906590 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: mds.0 10.255.128.1:6800/16937
is openallow rwx for mds.0 10.255.128.1:6800/16937
2012-12-25 03:55:11.906596 7fe097ad4700 20 mon.cc@0(leader) e2  caps allow rwx
2012-12-25 03:55:11.906607 7fe097ad4700 10 mon.cc@0(leader).mds e168
preprocess_query mdsbeacon(11597/cc up:active seq 1407 v168) v2 from
mds.0 10.255.128.1:6800/16937
2012-12-25 03:55:11.906614 7fe097ad4700 12 mon.cc@0(leader).mds e168
preprocess_beacon mdsbeacon(11597/cc up:active seq 1407 v168) v2 from
mds.0 10.255.128.1:6800/16937 compat={},rocompat={},incompat={1=base
v0.20,2=client writeable ranges,3=default file layouts on dirs,4=dir
inode in separate object}
2012-12-25 03:55:11.906622 7fe097ad4700 15 mon.cc@0(leader).mds e168
_note_beacon mdsbeacon(11597/cc up:active seq 1407 v168) v2 noting
time
2012-12-25 03:55:11.906627 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.128.1:6800/16937 -- mdsbeacon(11597/cc up:active seq 1407 v168)
v2 -- ?+0 0x26e38c0 con 0x26f7080
2012-12-25 03:55:13.262652 7fe0982d5700 11 mon.cc@0(leader) e2 tick
2012-12-25 03:55:13.262679 7fe0982d5700 10 mon.cc@0(leader).pg v830408
v830408: 408 pgs: 384 active+remapped, 24 active+degraded; 242 MB
data, 27478 MB used, 321 GB / 349 GB avail; 120/282 degraded (42.553%)
2012-12-25 03:55:13.262712 7fe0982d5700 10 mon.cc@0(leader).mds e168
e168: 1/1/1 up {0=cc=up:active}
2012-12-25 03:55:13.262726 7fe0982d5700 10 mon.cc@0(leader).osd e809
e809: 2 osds: 2 up, 2 in
2012-12-25 03:55:13.262779 7fe0982d5700 10 mon.cc@0(leader).osd e809
min_last_epoch_clean 806
2012-12-25 03:55:13.262789 7fe0982d5700 10 mon.cc@0(leader).log v832208 log
2012-12-25 03:55:13.262795 7fe0982d5700 10 mon.cc@0(leader).auth v2019
update_from_paxos()
2012-12-25 03:55:13.262799 7fe0982d5700 10 mon.cc@0(leader).auth v2019 auth

Logs from monitor when mapping on VM1:
2012-12-25 03:59:26.213790 7fe0961c9700  0 -- 10.255.128.1:6789/0 >>
10.255.0.13:0/816657923 pipe(0x283f8c0 sd=22 :6789 pgs=0 cs=0
l=0).accept peer addr is really 10.25
5.0.13:0/816657923 (socket is 10.255.0.13:39799/0)
2012-12-25 03:59:26.213806 7fe0961c9700 10 mon.cc@0(leader) e2
ms_verify_authorizer 10.255.0.13:0/816657923 client protocol 0
2012-12-25 03:59:26.213812 7fe0961c9700 10 In get_auth_session_handler
for protocol 0
2012-12-25 03:59:26.214061 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
unknown.0 10.255.0.13:0/816657923 1 ==== auth(proto 0 40 bytes epoch
0) ==== 66+0+0 (745319961 0 0
) 0x26dba00 con 0x26f78c0
2012-12-25 03:59:26.214080 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:59:26.214083 7fe097ad4700 10 mon.cc@0(leader) e2 do not
have session, making new one
2012-12-25 03:59:26.214086 7fe097ad4700 10 mon.cc@0(leader) e2
ms_dispatch new session MonSession: unknown.0 10.255.0.13:0/816657923
is open for unknown.0 10.255.0.13:0
/816657923
2012-12-25 03:59:26.214091 7fe097ad4700 10 mon.cc@0(leader) e2 setting
timeout on session
2012-12-25 03:59:26.214094 7fe097ad4700 20 mon.cc@0(leader) e2  caps
2012-12-25 03:59:26.214103 7fe097ad4700 10 mon.cc@0(leader).auth v2019
update_from_paxos()
2012-12-25 03:59:26.214105 7fe097ad4700 10 mon.cc@0(leader).auth v2019
preprocess_query auth(proto 0 40 bytes epoch 0) from unknown.0
10.255.0.13:0/816657923
2012-12-25 03:59:26.214115 7fe097ad4700 10 mon.cc@0(leader).auth v2019
prep_auth() blob_size=40
2012-12-25 03:59:26.214124 7fe097ad4700 10 mon.cc@0(leader).auth v2019
AuthMonitor::assign_global_id m=auth(proto 0 40 bytes epoch 0) mon=0/1
last_allocated=11696 max_g
lobal_id=11696
2012-12-25 03:59:26.214146 7fe097ad4700 10 mon.cc@0(leader).auth v2019
prepare_update auth(proto 0 40 bytes epoch 0) from unknown.0
10.255.0.13:0/816657923
2012-12-25 03:59:26.214150 7fe097ad4700 10 mon.cc@0(leader).auth v2019
prep_auth() blob_size=40
2012-12-25 03:59:26.214154 7fe097ad4700 10 mon.cc@0(leader).auth v2019
AuthMonitor::assign_global_id m=auth(proto 0 40 bytes epoch 0) mon=0/1
last_allocated=11696 max_g
lobal_id=11696
2012-12-25 03:59:26.214157 7fe097ad4700 10 mon.cc@0(leader).auth v2019
increasing max_global_id to 11796
2012-12-25 03:59:26.214163 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.13:0/816657923 -- mon_map v1 -- ?+0 0x2800960 con 0x26f78c0
2012-12-25 03:59:26.214190 7fe097ad4700 10 cephx server
client.winnie-test: start_session server_challenge e8fbf2c4dfb02344
2012-12-25 03:59:26.214195 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.13:0/816657923 -- auth_reply(proto 2 0 Success) v1 -- ?+0
0x26dbc00 con 0x26f78c0
2012-12-25 03:59:26.214206 7fe097ad4700 10 mon.cc@0(leader).auth v2019
encode_pending v 2020
2012-12-25 03:59:26.214210 7fe097ad4700 20 mon.cc@0(leader) e2
get_global_paxos_version 1665629
2012-12-25 03:59:26.214223 7fe097ad4700 15 store(/srv/ceph/mon) put_bl
auth/2020 = 19 bytes
2012-12-25 03:59:26.240769 7fe097ad4700 15 store(/srv/ceph/mon)
set_int auth_gv/2020 = 1665629
2012-12-25 03:59:26.265611 7fe097ad4700 15 store(/srv/ceph/mon)
set_int auth/last_committed = 2020
2012-12-25 03:59:26.303288 7fe097ad4700 10 mon.cc@0(leader).auth v2020
update_from_paxos()
2012-12-25 03:59:26.303309 7fe097ad4700 20 store(/srv/ceph/mon)
reading at off 0 of 19
2012-12-25 03:59:26.303316 7fe097ad4700 15 store(/srv/ceph/mon) get_bl
auth/2020 = 19 bytes
2012-12-25 03:59:26.303320 7fe097ad4700 10 mon.cc@0(leader).auth v2020
update_from_paxos() last_allocated_id=11697 max_global_id=11796
2012-12-25 03:59:26.303366 7fe097ad4700 15 store(/srv/ceph/mon) put_bl
auth/latest = 2035 bytes
2012-12-25 03:59:26.390068 7fe097ad4700 15 store(/srv/ceph/mon)
erase_ss auth/1999
2012-12-25 03:59:26.390205 7fe097ad4700 15 store(/srv/ceph/mon)
set_int auth/first_committed = 2000
2012-12-25 03:59:26.431526 7fe097ad4700 10 mon.cc@0(leader).auth v2020
create_pending v 2021
2012-12-25 03:59:26.431536 7fe097ad4700 10 mon.cc@0(leader).auth v2020
AuthMonitor::on_active()
2012-12-25 03:59:26.431540 7fe097ad4700 10 cephx keyserver:
_check_rotating_secrets
2012-12-25 03:59:26.431553 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
unknown.0 10.255.0.13:0/816657923 2 ==== auth(proto 2 32 bytes epoch
0) ==== 58+0+0 (1292146797 0
0) 0x26db200 con 0x26f78c0
2012-12-25 03:59:26.431566 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:59:26.431570 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: unknown.0
10.255.0.13:0/816657923 is open for unknown.0 10.255.0
.13:0/816657923
2012-12-25 03:59:26.431578 7fe097ad4700 20 mon.cc@0(leader) e2  caps
2012-12-25 03:59:26.431589 7fe097ad4700 10 mon.cc@0(leader).auth v2020
update_from_paxos()
2012-12-25 03:59:26.431592 7fe097ad4700 10 mon.cc@0(leader).auth v2020
preprocess_query auth(proto 2 32 bytes epoch 0) from unknown.0
10.255.0.13:0/816657923
2012-12-25 03:59:26.431598 7fe097ad4700 10 mon.cc@0(leader).auth v2020
prep_auth() blob_size=32
2012-12-25 03:59:26.431601 7fe097ad4700 10 cephx server
client.winnie-test: handle_request get_auth_session_key for
client.winnie-test
2012-12-25 03:59:26.431659 7fe097ad4700 20 cephx server
client.winnie-test:  checking key: req.key=24efef80f27143fa
expected_key=24efef80f27143fa
2012-12-25 03:59:26.431700 7fe097ad4700 10 cephx:
build_service_ticket_reply encoding 1 tickets with secret
AQBFAtNQwH9qHhAAdtwsbPKwmP1p3FTdmy0+Rg==
2012-12-25 03:59:26.431739 7fe097ad4700 10 cephx: build_service_ticket
service auth secret_id 134 ticket_info.ticket.name=client.winnie-test
2012-12-25 03:59:26.431772 7fe097ad4700 10 cephx keyserverdata:
get_caps: name=client.winnie-test
2012-12-25 03:59:26.431779 7fe097ad4700 10 cephx keyserverdata:
get_secret: num of caps=2
2012-12-25 03:59:26.431792 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.13:0/816657923 -- auth_reply(proto 2 0 Success) v1 -- ?+0
0x26dba00 con 0x26f78c0
2012-12-25 03:59:26.432154 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
unknown.0 10.255.0.13:0/816657923 3 ==== auth(proto 2 181 bytes epoch
0) ==== 207+0+0 (3268636739
0 0) 0x26dae00 con 0x26f78c0
2012-12-25 03:59:26.432173 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:59:26.432175 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: unknown.0
10.255.0.13:0/816657923 is openallow r for unknown.0 1
0.255.0.13:0/816657923
2012-12-25 03:59:26.432181 7fe097ad4700 20 mon.cc@0(leader) e2  caps allow r
2012-12-25 03:59:26.432189 7fe097ad4700 10 mon.cc@0(leader).auth v2020
update_from_paxos()
2012-12-25 03:59:26.432191 7fe097ad4700 10 mon.cc@0(leader).auth v2020
preprocess_query auth(proto 2 181 bytes epoch 0) from unknown.0
10.255.0.13:0/816657923
2012-12-25 03:59:26.432194 7fe097ad4700 10 mon.cc@0(leader).auth v2020
prep_auth() blob_size=181
2012-12-25 03:59:26.432197 7fe097ad4700 10 cephx server
client.winnie-test: handle_request get_principal_session_key
2012-12-25 03:59:26.432199 7fe097ad4700 10 cephx: verify_authorizer
decrypted service auth secret_id=134
2012-12-25 03:59:26.432231 7fe097ad4700 10 cephx: verify_authorizer
global_id=11697
2012-12-25 03:59:26.432259 7fe097ad4700 10 cephx: verify_authorizer ok
nonce a007d6f1f482ed4b reply_bl.length()=36
2012-12-25 03:59:26.432266 7fe097ad4700 10 cephx server
client.winnie-test:  ticket_req.keys = 7
2012-12-25 03:59:26.432268 7fe097ad4700 10 cephx server
client.winnie-test:  adding key for service mon
2012-12-25 03:59:26.432287 7fe097ad4700 10 cephx server
client.winnie-test:  adding key for service mds
2012-12-25 03:59:26.432300 7fe097ad4700 10 cephx keyserverdata:
get_caps: name=client.winnie-test
2012-12-25 03:59:26.432306 7fe097ad4700 10 cephx keyserverdata:
get_secret: num of caps=2
2012-12-25 03:59:26.432309 7fe097ad4700 10 cephx server
client.winnie-test:  adding key for service osd
2012-12-25 03:59:26.432322 7fe097ad4700 10 cephx keyserverdata:
get_caps: name=client.winnie-test
2012-12-25 03:59:26.432324 7fe097ad4700 10 cephx keyserverdata:
get_secret: num of caps=2
2012-12-25 03:59:26.432328 7fe097ad4700 10 cephx:
build_service_ticket_reply encoding 3 tickets with secret
AQCOFtlQyBy7GRAAEaTb/F1TkIaNgEf8EoJr5A==
2012-12-25 03:59:26.432350 7fe097ad4700 10 cephx: build_service_ticket
service mon secret_id 1590 ticket_info.ticket.name=client.winnie-test
2012-12-25 03:59:26.432379 7fe097ad4700 10 cephx: build_service_ticket
service mds secret_id 1590 ticket_info.ticket.name=client.winnie-test
2012-12-25 03:59:26.432413 7fe097ad4700 10 cephx: build_service_ticket
service osd secret_id 1590 ticket_info.ticket.name=client.winnie-test
2012-12-25 03:59:26.432438 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.13:0/816657923 -- auth_reply(proto 2 0 Success) v1 -- ?+0
0x26db200 con 0x26f78c0
2012-12-25 03:59:26.432766 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
client.11697 10.255.0.13:0/816657923 4 ====
mon_subscribe({monmap=0+,osdmap=0}) ==== 58+0+0 (631413433 0 0)
0x2743500 con 0x26f78c0
2012-12-25 03:59:26.432780 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:59:26.432782 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: unknown.0
10.255.0.13:0/816657923 is openallow r for unknown.0
10.255.0.13:0/816657923
2012-12-25 03:59:26.432787 7fe097ad4700 20 mon.cc@0(leader) e2  caps allow r
2012-12-25 03:59:26.432789 7fe097ad4700 10 mon.cc@0(leader) e2
handle_subscribe mon_subscribe({monmap=0+,osdmap=0})
2012-12-25 03:59:26.432795 7fe097ad4700 10 mon.cc@0(leader) e2
check_sub monmap next 0 have 2
2012-12-25 03:59:26.432800 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.0.13:0/816657923 -- mon_map v1 -- ?+0 0x2800780 con 0x26f78c0
2012-12-25 03:59:26.432951 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
unknown.0 10.255.0.13:0/816657923 -- osd_map(809..809 src has
309..809) v3 -- ?+0 0x26dae00
2012-12-25 03:59:26.432968 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
client.11697 10.255.0.13:0/816657923 -- mon_subscribe_ack(300s) v1 --
?+0 0x2705040
2012-12-25 03:59:26.437142 7fe097ad4700 10 mon.cc@0(leader) e2
ms_handle_reset 0x26f78c0 10.255.0.13:0/816657923
2012-12-25 03:59:26.437155 7fe097ad4700 10 mon.cc@0(leader) e2
reset/close on session unknown.0 10.255.0.13:0/816657923
2012-12-25 03:59:26.437159 7fe097ad4700 10 mon.cc@0(leader) e2
remove_session MonSession: unknown.0 10.255.0.13:0/816657923 is
openallow r unknown.0 10.255.0.13:0/816657923
2012-12-25 03:59:27.918541 7fe097ad4700  1 -- 10.255.128.1:6789/0 <==
mds.0 10.255.128.1:6800/16937 72 ==== mdsbeacon(11597/cc up:active seq
1471 v168) v2 ==== 241+0+0 (2761870254 0 0) 0x26e3080 con 0x26f7080
2012-12-25 03:59:27.918568 7fe097ad4700 20 mon.cc@0(leader) e2 have connection
2012-12-25 03:59:27.918571 7fe097ad4700 20 mon.cc@0(leader) e2
ms_dispatch existing session MonSession: mds.0 10.255.128.1:6800/16937
is openallow rwx for mds.0 10.255.128.1:6800/16937
2012-12-25 03:59:27.918578 7fe097ad4700 20 mon.cc@0(leader) e2  caps allow rwx
2012-12-25 03:59:27.918591 7fe097ad4700 10 mon.cc@0(leader).mds e168
preprocess_query mdsbeacon(11597/cc up:active seq 1471 v168) v2 from
mds.0 10.255.128.1:6800/16937
2012-12-25 03:59:27.918597 7fe097ad4700 12 mon.cc@0(leader).mds e168
preprocess_beacon mdsbeacon(11597/cc up:active seq 1471 v168) v2 from
mds.0 10.255.128.1:6800/16937 compat={},rocompat={},incompat={1=base
v0.20,2=client writeable ranges,3=default file layouts on dirs,4=dir
inode in separate object}
2012-12-25 03:59:27.918606 7fe097ad4700 15 mon.cc@0(leader).mds e168
_note_beacon mdsbeacon(11597/cc up:active seq 1471 v168) v2 noting
time
2012-12-25 03:59:27.918610 7fe097ad4700  1 -- 10.255.128.1:6789/0 -->
10.255.128.1:6800/16937 -- mdsbeacon(11597/cc up:active seq 1471 v168)
v2 -- ?+0 0x26e3340 con 0x26f7080
2012-12-25 03:59:28.276900 7fe0982d5700 11 mon.cc@0(leader) e2 tick
2012-12-25 03:59:28.276924 7fe0982d5700 10 mon.cc@0(leader).pg v830415
v830415: 408 pgs: 384 active+remapped, 24 active+degraded; 242 MB
data, 27478 MB used, 321 GB / 349 GB avail; 120/282 degraded (42.553%)
2012-12-25 03:59:28.276961 7fe0982d5700 10 mon.cc@0(leader).mds e168
e168: 1/1/1 up {0=cc=up:active}
2012-12-25 03:59:28.276971 7fe0982d5700 10 mon.cc@0(leader).osd e809
e809: 2 osds: 2 up, 2 in
2012-12-25 03:59:28.277010 7fe0982d5700 10 mon.cc@0(leader).osd e809
min_last_epoch_clean 806
2012-12-25 03:59:28.277016 7fe0982d5700 10 mon.cc@0(leader).log v832215 log
2012-12-25 03:59:28.277020 7fe0982d5700 10 mon.cc@0(leader).auth v2020
update_from_paxos()
2012-12-25 03:59:28.277025 7fe0982d5700 10 mon.cc@0(leader).auth v2020 auth
2012-12-25 03:59:28.277029 7fe0982d5700 10 cephx keyserver:
_check_rotating_secrets

Logs from VM1:
Dec 25 03:59:26 Debian-50-lenny-64-minimal kernel: [ 2377.382344]
libceph: client0 fsid d0c0d7d4-67cf-4c3b-ab83-e73fab897e17
Dec 25 03:59:26 Debian-50-lenny-64-minimal kernel: [ 2377.602640]
libceph: mon0 10.255.128.1:6789 session established

regards
Maciej Galkiewicz
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 3/3] HMP: show internal snapshots on a single device
From: Wenchao Xia @ 2012-12-25  3:11 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, aliguori, stefanha, qemu-devel, lcapitulino, pbonzini
In-Reply-To: <87mwx733d4.fsf@blackfin.pond.sub.org>

>>   
>> +static void do_info_snapshots_blk(Monitor *mon, const char *device)
>> +{
>> +    BlockDriverState *bs;
>> +    QEMUSnapshotInfo *sn_tab, *sn;
>> +    int nb_sns, i;
>> +    char buf[256];
>> +
>> +    /* find the target bs */
>> +    bs = bdrv_find(device);
>> +    if (!bs) {
>> +        monitor_printf(mon, "Device '%s' not found.\n", device);
>> +        return ;
>> +    }
>> +
>> +    if (!bdrv_can_snapshot(bs)) {
>> +        monitor_printf(mon, "Device '%s' can't have snapshot.\n", device);
>> +        return ;
>> +    }
> 
> Rest of the function is is essentially code copied from
> do_info_snapshots_vm().  Could it be factored out?
> 
  Sure, I forgot that before. I guess a better way is adding a QMP
interface first and using common code from it.

>> +
>> +    nb_sns = bdrv_snapshot_list(bs, &sn_tab);
>> +    if (nb_sns < 0) {
>> +        monitor_printf(mon, "Device %s bdrv_snapshot_list: error %d\n",
>> +                       device, nb_sns);
>> +        return;
>> +    }
>> +
>> +    if (nb_sns == 0) {
>> +        monitor_printf(mon, "There is no snapshot available.\n");
>> +        return;
>> +    }
>> +
>> +    monitor_printf(mon, "Device %s:\n", device);
>> +    monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));
>> +    for (i = 0; i < nb_sns; i++) {
>> +        sn = &sn_tab[i];
>> +        monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn));
>> +    }
>> +    g_free(sn_tab);
>> +    return;
>> +}
>> +
>> +void do_info_snapshots(Monitor *mon, const QDict *qdict)
>> +{
>> +    /* Todo, there should be a layer rebuild qdict before enter this func. */
> 
> I'm not sure I get this comment.
> 
> We usually capitalize TODO for easy grepping.
> 
  My mistake, this comments should have been removed, it is used before
where qdict was not rebuilt as a new one.

>> +    const char *device = qdict_get_try_str(qdict, "device");
>> +    if (!device) {
>> +        do_info_snapshots_vm(mon);
>> +    } else {
>> +        do_info_snapshots_blk(mon, device);
>> +    }
>> +    return;
>> +}
>> +
>>   void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
>>   {
>>       qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK,
> 


-- 
Best Regards

Wenchao Xia

^ permalink raw reply

* Re: conntrack-tools rpc helper
From: Richard A Nelson @ 2012-12-25  3:11 UTC (permalink / raw)
  To: netfilter
In-Reply-To: <50D90E08.40100@cavein.org>

I left out the end of the scenario :(

As a result, afaict, of the IP missmatch, and both RPC GETPORT streams being 
marked UNREPLIED, the Linux gateway box returns an ICMP PORT UNREACHABLE (there 
being no such open port on the gateway box).

On 12/24/2012 09:23 PM, Richard A Nelson wrote:
> I'm having a heck of a time getting this all going ;)
>
> Debian Sid/Experimental
> Linux 3.7.1
> conntrack toolchain downloded yesterday (stable, not git)
>
> I'm following the doc on conntrack-tools to enable RPC tracking (for NFS 
> support), and wind up with this state:
> # nfct helper list
> {
>     .name = rpc,
>     .queuenum = 0,
>     .l3protonum = 2,
>     .l4protonum = 6,
>     .priv_data_len = 16,
>     .status = disabled,
> };
> {
>     .name = rpc,
>     .queuenum = 0,
>     .l3protonum = 2,
>     .l4protonum = 17,
>     .priv_data_len = 16,
>     .status = disabled,
> };
>
> Why disabled?  conntrackd startup went fine, the nfct helper add went fine, 
> what am I missing ?
>
> And, of course, it doesn't work ;)
>
> I may be royally screwed anyway - due to the bizarre situation I'm trying to 
> support...
> LAN:  192.168/16 - mix of Linux, Windows, and AIX clients
> Gateway: 192.168.1.205 (Linux Gateway/Firewall)
> OpenConnect VPN to work (CISCO ASA client) - IBM
> IBM network - GSA NFS Servers
>
> The sticky point for a statefull firewall seems to be twofold:
> 1) AIX (at least 5.3) still does RPC mount lookups - even if NFSV4 and 
> port=2049 are specified
>     Which, it seems, is totally needless
>
> 2) The GSA infrastructure is layered, and littered with High Availability & 
> load balancing - but seems to break
>     extant rules...
> - My LAN client does a RPC GETPORT (MOUNT -V3) to snjgsa.sanjose.ibm.com
> - My firewall NATs the request
> - The GSA mainline server delegates (forwards, whatever) to a disk sever
> - The disk server (snjxgsasd2.sanjose.ibm.com) replies the RCP GETPORT request
>
> At this point, we have two streams, with matching ports, but differing IP 
> sets, both in UNREPLIED status.
>
> I am not at all sure, that even were I to get the RPC helper going, and it 
> issues and EXPECT, that things will work, but am willing to hack to make it so :)
>
>


-- 
Rick Nelson
Life'll kill ya                         -- Warren Zevon
Then you'll be dead                     -- Life'll kill ya


^ permalink raw reply

* [PATCH V2 2/2] rootfs: support read-only-rootfs image feature
From: Qi.Chen @ 2012-12-25  2:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhenfeng.Zhao
In-Reply-To: <cover.1356403679.git.Qi.Chen@windriver.com>

From: Chen Qi <Qi.Chen@windriver.com>

Two small tweaks at rootfs time:
1) If IMAGE_FEATUERS contains 'read-only-rootfs', we make
populate-volatile.sh run at rootfs time to set up basic files and
directories.
2) If IMAGE_FEATURES contains 'read-only-rootfs', mount options in
/etc/fstab is automatically tweaked to the appropriate value.

[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/core-image.bbclass |    4 +++-
 meta/classes/image.bbclass      |    6 ++++++
 meta/classes/rootfs_deb.bbclass |   14 ++++++++++++++
 meta/classes/rootfs_ipk.bbclass |   15 +++++++++++++++
 meta/classes/rootfs_rpm.bbclass |   20 +++++++++++++++++++-
 5 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
index 2e67018..ee0b397 100644
--- a/meta/classes/core-image.bbclass
+++ b/meta/classes/core-image.bbclass
@@ -28,6 +28,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
 # - dev-pkgs            - development packages (headers, etc.) for all installed packages in the rootfs
 # - dbg-pkgs            - debug symbol packages for all installed packages in the rootfs
 # - doc-pkgs            - documentation packages for all installed packages in the rootfs
+# - read-only-rootfs    - tweaks an image to support read-only rootfs
 #
 PACKAGE_GROUP_x11 = "packagegroup-core-x11"
 PACKAGE_GROUP_x11-base = "packagegroup-core-x11-base"
@@ -78,4 +79,5 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
 ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}'
 # Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled
 ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}'
-
+# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "fstab_tweak_mount_opt; ", "",d)}'
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 8bf718a..3854ee7 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -394,6 +394,12 @@ zap_root_password () {
 	mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
 } 
 
+# Change the mount options for rootfs in case of a read-only-rootfs image
+fstab_tweak_mount_opt () {
+	sed '/rootfs/ s/defaults/ro/' < ${IMAGE_ROOTFS}/etc/fstab > ${IMAGE_ROOTFS}/etc/fstab.new
+	mv ${IMAGE_ROOTFS}/etc/fstab.new ${IMAGE_ROOTFS}/etc/fstab
+}
+
 # allow openssh accept login with empty password string
 openssh_allow_empty_password () {
 	if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 293953d..052d5d9 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -84,6 +84,20 @@ fakeroot rootfs_deb_do_rootfs () {
 
 	${ROOTFS_POSTPROCESS_COMMAND}
 
+	# Let populate-volatile.sh run at rootfs time in case of an read-only rootfs
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false", d)}; then
+		if [ ! -e ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh ]; then
+			echo "${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh doesn't exist."
+			exit 1
+		else
+			${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
+			if [ $? != 0 ]; then
+				echo "Running populate-volatile.sh under ${IMAGE_ROOTFS} failed"
+				exit 1
+			fi
+		fi
+	fi
+
 	log_check rootfs
 }
 
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 5c962de..b851049 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -114,6 +114,21 @@ fakeroot rootfs_ipk_do_rootfs () {
 			remove_packaging_data_files
 		fi
 	fi
+
+        # Let populate-volatile.sh run at rootfs time in case of a read-only-rootfs image
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false", d)}; then
+		if [ ! -e ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh ]; then
+			echo "${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh doesn't exist."
+			exit 1
+		else
+			${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
+			if [ $? != 0 ]; then
+				echo "Running populate-volatile.sh under ${IMAGE_ROOTFS} failed"
+				exit 1
+			fi
+		fi
+	fi
+
 	set +x
 	log_check rootfs
 }
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index f7e4c5e..733764a 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -89,6 +89,8 @@ fakeroot rootfs_rpm_do_rootfs () {
 
 	# Report delayed package scriptlets
 	for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do
+                # We should add a check here to check whether we're building a read-only rootfs
+                # If so, exit 1, because there are still postintalls that are to be run on target.
 		if [ -f $i ]; then
 			echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`"
 		fi
@@ -104,7 +106,7 @@ for i in /etc/rpm-postinsts/*; do
 	if [ -f $i ] && $i; then
 		rm $i
 	else
-		echo "ERROR: postinst $i failed."
+		[ -f $i ] && echo "ERROR: postinst $i failed."
 	fi
 done
 rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
@@ -127,6 +129,22 @@ EOF
 	# Remove all remaining resolver files
 	rm -rf ${IMAGE_ROOTFS}/install
 
+	# Run init scripts that are necessary in case of an read-only rootfs
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false", d)}; then
+		if [ ! -e ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh ]; then
+			echo "${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh doesn't exist."
+			exit 1
+		else
+			# Run populate_volatile.sh under ${IMAGE_ROOTFS} to set up basic
+                        # directories and files which are related to volatile storage.
+			${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
+			if [ $? != 0 ]; then
+				echo "Running populate-volatile.sh under ${IMAGE_ROOTFS} failed"
+				exit 1
+			fi
+		fi
+	fi
+
 	log_check rootfs
 }
 
-- 
1.7.9.5




^ permalink raw reply related

* [PATCH V2 1/2] initscripts: support read-only rootfs
From: Qi.Chen @ 2012-12-25  2:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhenfeng.Zhao
In-Reply-To: <cover.1356403679.git.Qi.Chen@windriver.com>

From: Chen Qi <Qi.Chen@windriver.com>

Add read-only rootfs support to sysvinit startup system.

The main ideas here are:
1) Let populate-volatile.sh run at rootfs time to set up basic
directories and files needed by read-only rootfs.
2) Use symbolic links to create the illusion that some directories/files
are writable.

Two extra config files for read-only rootfs support are created, one for
minimal image -- volatiles-readonly-minimal, and the other for sato
image -- volatiles-readonly-sato.

[YOCTO #3404]
[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../initscripts/initscripts-1.0/bootmisc.sh        |    9 +-
 .../initscripts-1.0/populate-volatile.sh           |  285 ++++++++++----------
 .../initscripts/initscripts-1.0/volatiles          |    1 +
 .../initscripts-1.0/volatiles-readonly-minimal     |   23 ++
 .../initscripts-1.0/volatiles-readonly-sato        |   30 +++
 meta/recipes-core/initscripts/initscripts_1.0.bb   |   15 +-
 6 files changed, 210 insertions(+), 153 deletions(-)
 create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-minimal
 create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-sato

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index 4f76cb4..3b5a47f 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -54,14 +54,7 @@ fi
 
 #
 # This is as good a place as any for a sanity check
-# /tmp should be a symlink to /var/tmp to cut down on the number
-# of mounted ramdisks.
-if test ! -L /tmp && test -d /var/tmp
-then
-	rm -rf /tmp
-	ln -sf /var/tmp /tmp
-fi
-
+#
 # Set the system clock from hardware clock
 # If the timestamp is more recent than the current time,
 # use the timestamp instead.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index d2175d7..9c1ce23 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -8,192 +8,191 @@
 # Short-Description:  Populate the volatile filesystem
 ### END INIT INFO
 
-. /etc/default/rcS
-
-CFGDIR="/etc/default/volatiles"
-TMPROOT="/var/tmp"
+# Get ROOT_DIR
+DIRNAME=`dirname $0`
+ROOT_DIR=`echo $DIRNAME | sed -ne 's:etc/.*::p'`
+
+. ${ROOT_DIR}/etc/default/rcS
+# Test whether rootfs is read-only or not
+if > ${ROOT_DIR}/etc/test-read-write; then
+	ROOTFS_READ_ONLY=no
+	rm ${ROOT_DIR}/etc/test-read-write
+else
+	ROOTFS_READ_ONLY=yes
+fi 2>/dev/null
+
+# When running populat-volatile.sh at rootfs time, disable cache.
+[ "$ROOT_DIR" != "/" ] && VOLATILE_ENABLE_CACHE=no
+# If rootfs is read-only, disable cache.
+[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
+# All above statements will be moved to a central place, say var.sh which
+# encapsulates '. /etc/default/rcS'. 
+
+CFGDIR="${ROOT_DIR}/etc/default/volatiles"
+TMPROOT="${ROOT_DIR}/var/volatile/tmp"
 COREDEF="00_core"
+COREDEF_READONLY="00_core_readonly"
 
-[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
+[ "${VERBOSE}" != "no" ] && echo "Setting up basic files related to volatile storage under ${ROOT_DIR}."
 
 create_file() {
-	EXEC=" 
-	touch \"$1\"; 
-	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; 
-	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " 
+	EXEC="
+	touch \"$1\";
+	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" > /dev/null 2>&1;
+	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" > /dev/null 2>&1 "
 
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
 
 	[ -e "$1" ] && {
-	  [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+		[ "${VERBOSE}" != "no" ] && echo "Target $1 already exists. Skipping."
 	} || {
-	  eval $EXEC &
+		if [ "$ROOT_DIR" = "/" ]; then
+			eval $EXEC
+		else
+			# Some operations at rootfs time may fail and should fail,
+		        # but these failures should not be logged.
+			eval $EXEC > /dev/null 2>&1
+		fi
 	}
 }
 
 mk_dir() {
 	EXEC=" 
 	mkdir -p \"$1\"; 
-	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; 
-	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" 2>&1; 
+	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" 2>&1 "
 
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
 	
 	[ -e "$1" ] && {
-	  [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+		[ "${VERBOSE}" != "no" ] && echo "Target ${1} already exists. Skipping."
 	} || {
-	  eval $EXEC
+		if [ "$ROOT_DIR" = "/" ]; then
+			eval $EXEC
+		else
+			# Some operations at rootfs time may fail and should fail,
+                        # but these failures should not be logged.
+			eval $EXEC > /dev/null 2>&1
+		fi
 	}
 }
 
 link_file() {
-	EXEC="test -e \"$2\" -o -L $2 || ln -s \"$1\" \"$2\" >/dev/tty0 2>&1" 
-
-	test "$VOLATILE_ENABLE_CACHE" = yes && echo "	$EXEC" >> /etc/volatile.cache.build
-	
-	[ -e "$2" ] && {
-	  echo "Cannot create link over existing -${TNAME}-." >&2
-	} || {
-	  eval $EXEC &
-	}
+	EXEC="
+	if [ -L \"$2\" ]; then
+		[ \"$(readlink -f \"$2\")\" != \"$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+	elif [ -d \"$2\" ]; then
+		rm -rf \"$2\";
+                ln -sf \"$1\" \"$2\";
+        else
+                ln -sf \"$1\" \"$2\";
+	fi
+        "
+        test "$VOLATILE_ENABLE_CACHE" = yes && echo "   $EXEC" >> /etc/volatile.cache.build
+	if [ "$ROOT_DIR" = "/" ]; then
+		eval $EXEC
+	else
+		# Some operations at rootfs time may fail and should fail,
+                # but these failures should not be logged
+		eval $EXEC > /dev/null 2>&1
+	fi
 }
 
 check_requirements() {
+	cleanup() {
+		rm "${TMP_INTERMED}"
+		rm "${TMP_DEFINED}"
+		rm "${TMP_COMBINED}"
+	}
+	
+	CFGFILE="$1"
+	[ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0
+	[ `basename "${CFGFILE}"` = "${COREDEF_READONLY}" ] && return 0
+	TMP_INTERMED="${TMPROOT}/tmp.$$"
+	TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
+	TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
+
+	cat ${ROOT_DIR}/etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 2 > "${TMP_INTERMED}"
+	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+	NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
+	NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
+
+	[ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
+		echo "Undefined users:"
+		diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+		cleanup
+		return 1
+	}
 
-  cleanup() {
-    rm "${TMP_INTERMED}"
-    rm "${TMP_DEFINED}"
-    rm "${TMP_COMBINED}"
-    }
-    
-  CFGFILE="$1"
-
-  [ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0
-
-  TMP_INTERMED="${TMPROOT}/tmp.$$"
-  TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
-  TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
-
-
-  cat /etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
-  cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 2 > "${TMP_INTERMED}"
-  cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
-
-  NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
-  NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
-
-  [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
-    echo "Undefined users:"
-    diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
-    cleanup
-    return 1
-    }
-
-
-  cat /etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
-  cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 3 > "${TMP_INTERMED}"
-  cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
 
-  NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
-  NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
+	cat ${ROOT_DIR}/etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 3 > "${TMP_INTERMED}"
+	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
 
-  [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
-    echo "Undefined groups:"
-    diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
-    cleanup
-    return 1
-    }
+	NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
+	NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
 
-  # Add checks for required directories here
+	[ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
+		echo "Undefined groups:"
+		diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+		cleanup
+		return 1
+	}
 
-  cleanup
-  return 0
-  }
+	cleanup
+	return 0
+}
 
 apply_cfgfile() {
+	CFGFILE="$1"
+	[ ${VERBOSE} != "no" ] && echo "Applying config file: $CFGFILE"
+	
+	check_requirements "${CFGFILE}" || {
+		echo "Skipping ${CFGFILE}"
+		return 1
+	}
+
+	cat ${CFGFILE} | grep -v "^#" | sed -e '/^$/ d' | \
+		while read LINE; do
+		eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
+		TNAME=${ROOT_DIR}/${TNAME}
+		[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
+
+		[ "${TTYPE}" = "l" ] && {
+			TSOURCE="$TLTARGET"
+			[ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
+			link_file "${TSOURCE}" "${TNAME}"
+			continue
+		}
+		case "${TTYPE}" in
+			"f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
+				create_file "${TNAME}"
+				;;
+			"d")  [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
+				mk_dir "${TNAME}"
+				;;
+			*)    [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
+				continue
+				;;
+		esac
+	done
+	return 0
+}
 
-  CFGFILE="$1"
-
-  check_requirements "${CFGFILE}" || {
-    echo "Skipping ${CFGFILE}"
-    return 1
-    }
-
-  cat ${CFGFILE} | grep -v "^#" | \
-  while read LINE; do
-
-    eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
-
-    [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
-
-
-    [ "${TTYPE}" = "l" ] && {
-      TSOURCE="$TLTARGET"
-      [ -L "${TNAME}" ] || {
-        [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
-        link_file "${TSOURCE}" "${TNAME}" &
-        }
-      continue
-      }
-
-    [ -L "${TNAME}" ] && {
-      [ "${VERBOSE}" != "no" ] && echo "Found link."
-      NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
-      echo ${NEWNAME} | grep -v "^/" >/dev/null && {
-        TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
-        [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
-        } || {
-        TNAME="${NEWNAME}"
-        [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
-        }
-      }
-
-    case "${TTYPE}" in
-      "f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
-            create_file "${TNAME}" &
-	    ;;
-      "d")  [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
-            mk_dir "${TNAME}"
-	    # Add check to see if there's an entry in fstab to mount.
-	    ;;
-      *)    [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
-            continue
-	    ;;
-    esac
-
-
-    done
-
-  return 0
-
-  }
-
-clearcache=0
-exec 9</proc/cmdline
-while read line <&9
-do
-	case "$line" in
-		*clearcache*)  clearcache=1
-			       ;;
-		*)	       continue
-			       ;;
-	esac
-done
-exec 9>&-
-
-if test -e /etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
+if test -e ${ROOT_DIR}/etc/volatile.cache -a $VOLATILE_ENABLE_CACHE = yes -a x$1 != xupdate
 then
-	sh /etc/volatile.cache
+	sh ${ROOT_DIR}/etc/volatile.cache
 else	
-	rm -f /etc/volatile.cache /etc/volatile.cache.build
+	rm -f ${ROOT_DRI}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build
 	for file in `ls -1 "${CFGDIR}" | sort`; do
 		apply_cfgfile "${CFGDIR}/${file}"
 	done
 
-	[ -e /etc/volatile.cache.build ] && sync && mv /etc/volatile.cache.build /etc/volatile.cache
+	[ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
 fi
 
-if test -f /etc/ld.so.cache -a ! -f /var/run/ld.so.cache
+if [ "${ROOT_DIR}" = "/" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
 then
 	ln -s /etc/ld.so.cache /var/run/ld.so.cache
 fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index e0741aa..f7e2ef7 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -31,6 +31,7 @@ l root root 1777 /var/lock /var/volatile/lock
 l root root 0755 /var/log /var/volatile/log
 l root root 0755 /var/run /var/volatile/run
 l root root 1777 /var/tmp /var/volatile/tmp
+l root root 1777 /tmp /var/tmp
 d root root 0755 /var/lock/subsys none
 f root root 0664 /var/log/wtmp none
 f root root 0664 /var/run/utmp none
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-minimal b/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-minimal
new file mode 100644
index 0000000..6169ecc
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-minimal
@@ -0,0 +1,23 @@
+# This configuration file lists filesystem objects specific to readonly rootfs
+# that should get verified during startup and be created if missing.
+#
+# Every line must either be a comment starting with #
+# or a definition of format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check its existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-sato b/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-sato
new file mode 100644
index 0000000..e128869
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles-readonly-sato
@@ -0,0 +1,30 @@
+# This configuration file lists filesystem objects specific to readonly rootfs
+# that should get verified during startup and be created if missing.
+#
+# Every line must either be a comment starting with #
+# or a definition of format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check it's existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
+d root root 0755 /var/volatile/lib/ none
+d root root 0755 /var/volatile/lib/dropbear/ none
+d root root 0755 /var/volatile/lib/nfs/ none
+d root root 1777 /var/volatile/lib/dbus/ none
+l root root 0755 /var/lib/dropbear /var/volatile/lib/dropbear
+l root root 0755 /var/lib/nfs /var/volatile/lib/nfs
+l root root 0755 /var/lib/dbus /var/volatile/lib/dbus
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 39be9a8..d0869ea 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PR = "r138"
+PR = "r139"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -30,8 +30,10 @@ SRC_URI = "file://functions \
            file://device_table.txt \
            file://populate-volatile.sh \
            file://volatiles \
+           file://volatiles-readonly-minimal \
+           file://volatiles-readonly-sato \
            file://save-rtc.sh \
-	   file://GPLv2.patch"
+           file://GPLv2.patch"
 
 SRC_URI_append_arm = " file://alignment.sh"
 
@@ -86,6 +88,15 @@ do_install () {
 	install -m 0755    ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/save-rtc.sh	${D}${sysconfdir}/init.d
 	install -m 0644    ${WORKDIR}/volatiles		${D}${sysconfdir}/default/volatiles/00_core
+        # Install read-only rootfs specific config files in case of an read-only-rootfs image
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+	        if ${@base_contains("IMAGE_FEATURES", "x11-sato", "true", "false" ,d)}; then
+                        install -m 0644 ${WORKDIR}/volatiles-readonly-sato ${D}${sysconfdir}/default/volatiles/00_core_readonly
+                else
+                        install -m 0644 ${WORKDIR}/volatiles-readonly-minimal ${D}${sysconfdir}/default/volatiles/00_core_readonly
+                fi
+	fi
+
 	if [ "${TARGET_ARCH}" = "arm" ]; then
 		install -m 0755 ${WORKDIR}/alignment.sh	${D}${sysconfdir}/init.d
 	fi
-- 
1.7.9.5




^ permalink raw reply related

* USB 2.0 (EHCI) keeps crapping out (3.2.29)
From: Logan Rathbone @ 2012-12-25  3:02 UTC (permalink / raw)
  To: linux-kernel

*** NOTE:  Kindly CC me directly if you reply to list since I'm not an 
LKML subscriber. ***

Running vanilla 3.2.29 (Slackware 14.0).  I also had this issue on 
2.6.37.6 and *possibly* 2.6.33.x, but I don't recall.

Every now and again (could be every few days, could take a couple of 
weeks... depends.) USB 2.0 stops working.  My scanner as well as certain 
mass-storage devices that are USB-2.0 compatible fail to function all of 
a sudden.

With the said mass storage devices, I get lots of errors like this in my 
logs:

hub 1-0:1.0: unable to enumerate USB device on port 3

Devices that have previously been mounted and accessed successfully 
begin giving input/output errors when I try to ls them.

rmmod'ing ehci_hcd and modprobe'ing it again resolves the issue until it 
occurs again.

It *could* be a hardware problem, but it seems odd that unloading & 
reloading the module instantly makes it work perfectly again.

Via USB 1.1/2.0 controller from circa 2002-2003.

If anyone has any ideas, please let me know...

logan@logancomp:~$ /sbin/lspci |grep -i usb
00:10.0 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 
Controller (rev 80)
00:10.1 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 
Controller (rev 80)
00:10.2 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 
Controller (rev 80)
00:10.3 USB controller: VIA Technologies, Inc. USB 2.0 (rev 82)

logan@logancomp:~$ cat /proc/cmdline
auto BOOT_IMAGE=Slackware ro root=802 nohz=off highres=off 
clocksource=jiffies acpi_enforce_resources=lax vt.default_utf8=0

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 1/3] HMP: add QDict to info callback handler
From: Wenchao Xia @ 2012-12-25  2:52 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: kwolf, aliguori, stefanha, qemu-devel, lcapitulino, pbonzini
In-Reply-To: <87r4mj33oi.fsf@blackfin.pond.sub.org>

OK, will add that in commit message.

> 
> For now, the new argument is NULL, not an empty dictionary.  Could be
> mentioned in the commit message.  Not worth a respin.
> 
> [...]
> 


-- 
Best Regards

Wenchao Xia

^ permalink raw reply

* [PATCH] mfd: pcf50633: Init pcf->dev before using it
From: Axel Lin @ 2012-12-25  2:52 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Harald Welte, Lars-Peter Clausen, linux-kernel

Current code uses pcf->dev in the dev_err call before setting it to
&client->dev. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/pcf50633-core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 64803f1..d115673 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client,
 	if (!pcf)
 		return -ENOMEM;
 
+	i2c_set_clientdata(client, pcf);
+	pcf->dev = &client->dev;
 	pcf->pdata = pdata;
 
 	mutex_init(&pcf->lock);
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	i2c_set_clientdata(client, pcf);
-	pcf->dev = &client->dev;
-
 	version = pcf50633_reg_read(pcf, 0);
 	variant = pcf50633_reg_read(pcf, 1);
 	if (version < 0 || variant < 0) {
-- 
1.7.9.5




^ permalink raw reply related

* [PATCH 1/2] ipv4/ip_gre: set transport header correctly to gre header
From: Isaku Yamahata @ 2012-12-25  2:51 UTC (permalink / raw)
  To: netdev; +Cc: yamahata

ipgre_tunnel_xmit() incorrectly sets transport header to inner payload
instead of GRE header. It seems copy-and-pasted from ipip.c.
So set transport header to gre header.
(In ipip case the transport header is the inner ip header, so that's
correct.)

Found by inspection. In practice the incorrect transport header
doesn't matter because the skb usually is sent to another net_device
or socket, so the transport header isn't referenced.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 net/ipv4/ip_gre.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 58cb627..303012a 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -912,9 +912,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
 		/* Warning : tiph value might point to freed memory */
 	}
 
-	skb_reset_transport_header(skb);
 	skb_push(skb, gre_hlen);
 	skb_reset_network_header(skb);
+	skb_set_transport_header(skb, sizeof(*iph));
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
 			      IPSKB_REROUTED);
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/2] ipv6/ip6_gre: set transport header correctly
From: Isaku Yamahata @ 2012-12-25  2:51 UTC (permalink / raw)
  To: netdev; +Cc: yamahata
In-Reply-To: <a6eb43766a3959d111cde14b237d435de0b19e15.1356403805.git.yamahata@valinux.co.jp>

ip6gre_xmit2() incorrectly sets transport header to inner payload
instead of GRE header. It seems copy-and-pasted from ipip.c.
Set transport header to gre header.
(In ipip case the transport header is the inner ip header, so that's
correct.)

Found by inspection. In practice the incorrect transport header
doesn't matter because the skb usually is sent to another net_device
or socket, so the transport header isn't referenced.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 net/ipv6/ip6_gre.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 867466c..c727e47 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -758,8 +758,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
 		skb_dst_set_noref(skb, dst);
 	}
 
-	skb->transport_header = skb->network_header;
-
 	proto = NEXTHDR_GRE;
 	if (encap_limit >= 0) {
 		init_tel_txopt(&opt, encap_limit);
@@ -768,6 +766,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
 
 	skb_push(skb, gre_hlen);
 	skb_reset_network_header(skb);
+	skb_set_transport_header(skb, sizeof(*ipv6h));
 
 	/*
 	 *	Push down and install the IP header.
-- 
1.7.10.4

^ permalink raw reply related

* devicetree support for efikasb
From: Matt Sealey @ 2012-12-25  2:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CA+Bgp3PsDc3bQT7_Qxok1cfC4m5ACx=5G-hdAOK2Jcp90NMNdg@mail.gmail.com>

also Tested-by: Matt Sealey <matt@genesi-usa.com>

Matt Sealey <matt@genesi-usa.com>
Product Development Analyst, Genesi USA, Inc.


On Thu, Dec 20, 2012 at 10:34 AM, Steev Klimaszewski
<steev@genesi-usa.com>wrote:

> Hi Sascha,
>
> I've given the patchset a (very) quick once over, but both myself and
> Arnaud have tested PATA - any chance you could push them to the ata mailing
> list to get accepted (I believe that's where they belong) - Feel free to
> add my Tested-By: and Arnaud said his as well.
>
>
> On Wed, Dec 19, 2012 at 2:56 AM, Sascha Hauer <s.hauer@pengutronix.de>wrote:
>
>> On Tue, Dec 18, 2012 at 11:30:17AM +0100, Arnaud Patard wrote:
>> > Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> writes:
>> > Hi,
>> >
>> >
>> > >>
>> > >>>
>> > >>> >
>> > >>> > I'm not posting the patches here since I do not consider them
>> ready, but
>> > >>> > for everyone interested you can pull the following git tree. I
>> have no
>> > >>> > idea if the patches work together with the preinstalled U-Boot, I
>> use
>> > >>> > barebox on the Smartbook.
>> > >>>
>> > >>> I've (very quickly) tested it yesterday and it didn't even boot.
>> I've
>> > >>> yet to look at the serial port output to check if it's a problem on
>> my
>> > >>> side or a bug in the kernel.
>> > >>
>> > >> Do you mean barebox doesn't boot or the kernel doesn't boot?
>> > >
>> > > No idea. All I get is a black screen, so I need to look at the serial
>> > > output. Oh, it's uboot not barebox btw. Sorry for the confusion.
>> >
>> > After digging a little bit, turns out that someone failed to make sure
>> > that clocks are enabled before reading/writing some
>> > registers. imx51_ipu_mipi_setup() is called very early in the boot and
>> > it's way before the clocks are enabled. So, as the clock is not enabled
>> > when booting on my sb, it's freezing hard. A quick hack to move the call
>> > to the end of mx51_clocks_init() allows to boot.
>>
>> Shawn already noticed this. A fix should appear soon in mainline.
>>
>> >
>> > Then, I'm getting a oops. i2c doesn't seem to work (maybe related to
>> > Matt and Steev remarks about pinctrl settings) so the edid is not found
>> > and when the mtl017 driver is trying to fall back, it falls back the the
>> > edid which may be provided by the dts. As it's not the case, it's
>> > crashing at the memcmp() call. With a new test to check that, I can boot
>> > on my mmc.
>> >
>> > PATA is detected too but usb doesn't detect anything on the bus.
>> >
>> > Next steps will probably be something like checking mtl017/lvds,lcd
>> > gpios/regulators/pinctrl and then look at usb.
>>
>> This is probably because I'm using barebox. The i2c pinmux is probably
>> configured in the bootloader correctly. That should be easy to fix.
>> USB may be more work though...
>>
>> >
>> > Oh, btw, the smartbook have only 512M of ram, not 1G so you need to fix
>> > that in your dts file.
>>
>> Will do. The bootloader fixes that for me currently, so I didn't realize
>> this.
>>
>> Sascha
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Industrial Linux Solutions                 | http://www.pengutronix.de/ |
>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0
>>  |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555|
>>
>
>
>
> --
> Best Regards,
> Steev
>
> Steev Klimaszewski <steev@genesi-usa.com>
> Senior Software Engineer, Genesi USA, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121224/3b4fbc62/attachment-0001.html>

^ permalink raw reply

* [PATCH v2 4/8] MFD:rtsx: Add callback function switch_output_voltage
From: wei_wang @ 2012-12-25  2:43 UTC (permalink / raw)
  To: cjb, sameo
  Cc: devel, linux-kernel, linux-mmc, gregkh, arnd, oakad, bp, Wei WANG
In-Reply-To: <cover.1356403281.git.wei_wang@realsil.com.cn>

From: Wei WANG <wei_wang@realsil.com.cn>

Different card reader has different method to switch output voltage,
add this callback to let the card reader implement its individual switch
function.

Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
---
 drivers/mfd/rtl8411.c        |   16 ++++++++++++++++
 drivers/mfd/rts5209.c        |   20 ++++++++++++++++++++
 drivers/mfd/rts5229.c        |   20 ++++++++++++++++++++
 drivers/mfd/rtsx_pcr.c       |    9 +++++++++
 include/linux/mfd/rtsx_pci.h |   24 ++++++++++++++++++++----
 5 files changed, 85 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 89f046c..5058ba8 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -112,6 +112,21 @@ static int rtl8411_card_power_off(struct rtsx_pcr *pcr, int card)
 			BPP_LDO_POWB, BPP_LDO_SUSPEND);
 }
 
+static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+	u8 mask, val;
+
+	mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_MASK;
+	if (voltage == OUTPUT_3V3)
+		val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_3V3;
+	else if (voltage == OUTPUT_1V8)
+		val = (BPP_ASIC_1V8 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_1V8;
+	else
+		return -EINVAL;
+
+	return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
+}
+
 static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
 {
 	unsigned int card_exist;
@@ -172,6 +187,7 @@ static const struct pcr_ops rtl8411_pcr_ops = {
 	.disable_auto_blink = rtl8411_disable_auto_blink,
 	.card_power_on = rtl8411_card_power_on,
 	.card_power_off = rtl8411_card_power_off,
+	.switch_output_voltage = rtl8411_switch_output_voltage,
 	.cd_deglitch = rtl8411_cd_deglitch,
 };
 
diff --git a/drivers/mfd/rts5209.c b/drivers/mfd/rts5209.c
index 283a4f1..ba74de8 100644
--- a/drivers/mfd/rts5209.c
+++ b/drivers/mfd/rts5209.c
@@ -144,6 +144,25 @@ static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card)
 	return rtsx_pci_send_cmd(pcr, 100);
 }
 
+static int rts5209_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+	int err;
+
+	if (voltage == OUTPUT_3V3) {
+		err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
+		if (err < 0)
+			return err;
+	} else if (voltage == OUTPUT_1V8) {
+		err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
+		if (err < 0)
+			return err;
+	} else {
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct pcr_ops rts5209_pcr_ops = {
 	.extra_init_hw = rts5209_extra_init_hw,
 	.optimize_phy = rts5209_optimize_phy,
@@ -153,6 +172,7 @@ static const struct pcr_ops rts5209_pcr_ops = {
 	.disable_auto_blink = rts5209_disable_auto_blink,
 	.card_power_on = rts5209_card_power_on,
 	.card_power_off = rts5209_card_power_off,
+	.switch_output_voltage = rts5209_switch_output_voltage,
 	.cd_deglitch = NULL,
 };
 
diff --git a/drivers/mfd/rts5229.c b/drivers/mfd/rts5229.c
index b9dbab2..ec1747a 100644
--- a/drivers/mfd/rts5229.c
+++ b/drivers/mfd/rts5229.c
@@ -114,6 +114,25 @@ static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card)
 	return rtsx_pci_send_cmd(pcr, 100);
 }
 
+static int rts5229_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+	int err;
+
+	if (voltage == OUTPUT_3V3) {
+		err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
+		if (err < 0)
+			return err;
+	} else if (voltage == OUTPUT_1V8) {
+		err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
+		if (err < 0)
+			return err;
+	} else {
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct pcr_ops rts5229_pcr_ops = {
 	.extra_init_hw = rts5229_extra_init_hw,
 	.optimize_phy = rts5229_optimize_phy,
@@ -123,6 +142,7 @@ static const struct pcr_ops rts5229_pcr_ops = {
 	.disable_auto_blink = rts5229_disable_auto_blink,
 	.card_power_on = rts5229_card_power_on,
 	.card_power_off = rts5229_card_power_off,
+	.switch_output_voltage = rts5229_switch_output_voltage,
 	.cd_deglitch = NULL,
 };
 
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 1dc64bb..99e12b8 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -702,6 +702,15 @@ int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card)
 }
 EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
 
+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+	if (pcr->ops->switch_output_voltage)
+		return pcr->ops->switch_output_voltage(pcr, voltage);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(rtsx_pci_switch_output_voltage);
+
 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr)
 {
 	unsigned int val;
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index bebe9f9..2e3e2e0 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -158,10 +158,9 @@
 #define SG_TRANS_DATA		(0x02 << 4)
 #define SG_LINK_DESC		(0x03 << 4)
 
-/* SD bank voltage */
-#define SD_IO_3V3		0
-#define SD_IO_1V8		1
-
+/* Output voltage */
+#define OUTPUT_3V3		0
+#define OUTPUT_1V8		1
 
 /* Card Clock Enable Register */
 #define SD_CLK_EN			0x04
@@ -201,6 +200,20 @@
 #define CHANGE_CLK			0x01
 
 /* LDO_CTL */
+#define BPP_ASIC_1V7			0x00
+#define BPP_ASIC_1V8			0x01
+#define BPP_ASIC_1V9			0x02
+#define BPP_ASIC_2V0			0x03
+#define BPP_ASIC_2V7			0x04
+#define BPP_ASIC_2V8			0x05
+#define BPP_ASIC_3V2			0x06
+#define BPP_ASIC_3V3			0x07
+#define BPP_REG_TUNED18			0x07
+#define BPP_TUNED18_SHIFT_8402		5
+#define BPP_TUNED18_SHIFT_8411		4
+#define BPP_PAD_MASK			0x04
+#define BPP_PAD_3V3			0x04
+#define BPP_PAD_1V8			0x00
 #define BPP_LDO_POWB			0x03
 #define BPP_LDO_ON			0x00
 #define BPP_LDO_SUSPEND			0x02
@@ -688,6 +701,8 @@ struct pcr_ops {
 	int		(*disable_auto_blink)(struct rtsx_pcr *pcr);
 	int		(*card_power_on)(struct rtsx_pcr *pcr, int card);
 	int		(*card_power_off)(struct rtsx_pcr *pcr, int card);
+	int		(*switch_output_voltage)(struct rtsx_pcr *pcr,
+						u8 voltage);
 	unsigned int	(*cd_deglitch)(struct rtsx_pcr *pcr);
 };
 
@@ -783,6 +798,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
 		u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
 int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
 int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage);
 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
 void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);
 
-- 
1.7.9.5


^ permalink raw reply related


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.