All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mds: update backtrace when old format inode is touched
@ 2013-08-23  1:42 Yan, Zheng
  2013-08-23 10:09 ` Alexandre Oliva
  2013-10-16 23:35 ` Gregory Farnum
  0 siblings, 2 replies; 5+ messages in thread
From: Yan, Zheng @ 2013-08-23  1:42 UTC (permalink / raw)
  To: ceph-devel; +Cc: sage, Yan, Zheng

From: "Yan, Zheng" <zheng.z.yan@intel.com>

We updated inode format version to 7 when introducing inode backtrace.
If we found a inode's format version < 7 when fetching the inode, set
the inode's backtrace_version to 0, to indicate the inode's backtrace
is out of data. When touching a inode with backtrace_version == 0, we
also update its backtrace.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/Locker.cc   | 4 ++++
 src/mds/Server.cc   | 5 +++++
 src/mds/mdstypes.cc | 2 ++
 3 files changed, 11 insertions(+)

diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index 99bd761..e274204 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -2898,6 +2898,10 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
 
     wrlock_force(&in->xattrlock, mut);
   }
+
+  // update backtrace for old format inode. (see inode_t::decode)
+  if (pi->backtrace_version == 0)
+    pi->update_backtrace();
   
   mut->auth_pin(in);
   mdcache->predirty_journal_parents(mut, &le->metablob, in, 0, PREDIRTY_PRIMARY, 0, follows);
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 466d481..b50169e 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -3207,6 +3207,11 @@ void Server::handle_client_setattr(MDRequest *mdr)
 
   // log + wait
   le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
+
+  // update backtrace for old format inode. (see inode_t::decode)
+  if (pi->backtrace_version == 0)
+    pi->update_backtrace();
+
   mdcache->predirty_journal_parents(mdr, &le->metablob, cur, 0, PREDIRTY_PRIMARY, false);
   mdcache->journal_dirty_inode(mdr, &le->metablob, cur);
   
diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc
index 6886786..f8ec549 100644
--- a/src/mds/mdstypes.cc
+++ b/src/mds/mdstypes.cc
@@ -294,6 +294,8 @@ void inode_t::decode(bufferlist::iterator &p)
     ::decode(backtrace_version, p);
   if (struct_v >= 7)
     ::decode(old_pools, p);
+  else
+    backtrace_version = 0; // note inode which has no backtrace
 
   DECODE_FINISH(p);
 }
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mds: update backtrace when old format inode is touched
  2013-08-23  1:42 [PATCH] mds: update backtrace when old format inode is touched Yan, Zheng
@ 2013-08-23 10:09 ` Alexandre Oliva
  2013-08-23 11:36   ` Alexandre Oliva
  2013-10-16 23:35 ` Gregory Farnum
  1 sibling, 1 reply; 5+ messages in thread
From: Alexandre Oliva @ 2013-08-23 10:09 UTC (permalink / raw)
  To: Yan, Zheng; +Cc: ceph-devel, sage

On Aug 22, 2013, "Yan, Zheng" <zheng.z.yan@intel.com> wrote:

> We updated inode format version to 7 when introducing inode backtrace.
> If we found a inode's format version < 7 when fetching the inode, set
> the inode's backtrace_version to 0, to indicate the inode's backtrace
> is out of data. When touching a inode with backtrace_version == 0, we
> also update its backtrace.

> +  if (pi->backtrace_version == 0)
> +    pi->update_backtrace();
   
AFAICT all this does is to update the backtrace version number in the
cached-in-memory inode.  What am I missing?  Or is the code missing
something? :-)

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mds: update backtrace when old format inode is touched
  2013-08-23 10:09 ` Alexandre Oliva
@ 2013-08-23 11:36   ` Alexandre Oliva
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Oliva @ 2013-08-23 11:36 UTC (permalink / raw)
  To: Yan, Zheng; +Cc: ceph-devel, sage

On Aug 23, 2013, Alexandre Oliva <oliva@gnu.org> wrote:

> On Aug 22, 2013, "Yan, Zheng" <zheng.z.yan@intel.com> wrote:
>> We updated inode format version to 7 when introducing inode backtrace.
>> If we found a inode's format version < 7 when fetching the inode, set
>> the inode's backtrace_version to 0, to indicate the inode's backtrace
>> is out of data. When touching a inode with backtrace_version == 0, we
>> also update its backtrace.

>> +  if (pi->backtrace_version == 0)
>> +    pi->update_backtrace();
   
> AFAICT all this does is to update the backtrace version number in the
> cached-in-memory inode.  What am I missing?  Or is the code missing
> something? :-)

N/m, I see now that this eventually causes _mark_dirty_parent to be
called, which in turn gets the parent attribute updated.
inode_t::is_backtrace_updated() means exactly the opposite of what I
expected ;-)

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mds: update backtrace when old format inode is touched
  2013-08-23  1:42 [PATCH] mds: update backtrace when old format inode is touched Yan, Zheng
  2013-08-23 10:09 ` Alexandre Oliva
@ 2013-10-16 23:35 ` Gregory Farnum
  2013-10-21  1:14   ` Yan, Zheng
  1 sibling, 1 reply; 5+ messages in thread
From: Gregory Farnum @ 2013-10-16 23:35 UTC (permalink / raw)
  To: Yan, Zheng; +Cc: ceph-devel

I came across this patch while going through my email backlog and it
looks like we haven't pulled in this patch or anything like it. Did
you do something about this problem in a different way?
(The patch doesn't apply cleanly so I'll need to update it if this is
still what we've got.)
-Greg
Software Engineer #42 @ http://inktank.com | http://ceph.com


On Thu, Aug 22, 2013 at 6:42 PM, Yan, Zheng <zheng.z.yan@intel.com> wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
>
> We updated inode format version to 7 when introducing inode backtrace.
> If we found a inode's format version < 7 when fetching the inode, set
> the inode's backtrace_version to 0, to indicate the inode's backtrace
> is out of data. When touching a inode with backtrace_version == 0, we
> also update its backtrace.
>
> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  src/mds/Locker.cc   | 4 ++++
>  src/mds/Server.cc   | 5 +++++
>  src/mds/mdstypes.cc | 2 ++
>  3 files changed, 11 insertions(+)
>
> diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
> index 99bd761..e274204 100644
> --- a/src/mds/Locker.cc
> +++ b/src/mds/Locker.cc
> @@ -2898,6 +2898,10 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
>
>      wrlock_force(&in->xattrlock, mut);
>    }
> +
> +  // update backtrace for old format inode. (see inode_t::decode)
> +  if (pi->backtrace_version == 0)
> +    pi->update_backtrace();
>
>    mut->auth_pin(in);
>    mdcache->predirty_journal_parents(mut, &le->metablob, in, 0, PREDIRTY_PRIMARY, 0, follows);
> diff --git a/src/mds/Server.cc b/src/mds/Server.cc
> index 466d481..b50169e 100644
> --- a/src/mds/Server.cc
> +++ b/src/mds/Server.cc
> @@ -3207,6 +3207,11 @@ void Server::handle_client_setattr(MDRequest *mdr)
>
>    // log + wait
>    le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
> +
> +  // update backtrace for old format inode. (see inode_t::decode)
> +  if (pi->backtrace_version == 0)
> +    pi->update_backtrace();
> +
>    mdcache->predirty_journal_parents(mdr, &le->metablob, cur, 0, PREDIRTY_PRIMARY, false);
>    mdcache->journal_dirty_inode(mdr, &le->metablob, cur);
>
> diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc
> index 6886786..f8ec549 100644
> --- a/src/mds/mdstypes.cc
> +++ b/src/mds/mdstypes.cc
> @@ -294,6 +294,8 @@ void inode_t::decode(bufferlist::iterator &p)
>      ::decode(backtrace_version, p);
>    if (struct_v >= 7)
>      ::decode(old_pools, p);
> +  else
> +    backtrace_version = 0; // note inode which has no backtrace
>
>    DECODE_FINISH(p);
>  }
> --
> 1.8.1.4
>
> --
> 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	[flat|nested] 5+ messages in thread

* Re: [PATCH] mds: update backtrace when old format inode is touched
  2013-10-16 23:35 ` Gregory Farnum
@ 2013-10-21  1:14   ` Yan, Zheng
  0 siblings, 0 replies; 5+ messages in thread
From: Yan, Zheng @ 2013-10-21  1:14 UTC (permalink / raw)
  To: Gregory Farnum; +Cc: Yan, Zheng, ceph-devel

On Thu, Oct 17, 2013 at 7:35 AM, Gregory Farnum <greg@inktank.com> wrote:
> I came across this patch while going through my email backlog and it
> looks like we haven't pulled in this patch or anything like it. Did
> you do something about this problem in a different way?
> (The patch doesn't apply cleanly so I'll need to update it if this is
> still what we've got.)

I didn't do anything else about the issue. I updated the patch and
sent a pull request
github.com/ceph/ceph/pull/750

Regards
Yan, Zheng



> -Greg
> Software Engineer #42 @ http://inktank.com | http://ceph.com
>
>
> On Thu, Aug 22, 2013 at 6:42 PM, Yan, Zheng <zheng.z.yan@intel.com> wrote:
>> From: "Yan, Zheng" <zheng.z.yan@intel.com>
>>
>> We updated inode format version to 7 when introducing inode backtrace.
>> If we found a inode's format version < 7 when fetching the inode, set
>> the inode's backtrace_version to 0, to indicate the inode's backtrace
>> is out of data. When touching a inode with backtrace_version == 0, we
>> also update its backtrace.
>>
>> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
>> ---
>>  src/mds/Locker.cc   | 4 ++++
>>  src/mds/Server.cc   | 5 +++++
>>  src/mds/mdstypes.cc | 2 ++
>>  3 files changed, 11 insertions(+)
>>
>> diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
>> index 99bd761..e274204 100644
>> --- a/src/mds/Locker.cc
>> +++ b/src/mds/Locker.cc
>> @@ -2898,6 +2898,10 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
>>
>>      wrlock_force(&in->xattrlock, mut);
>>    }
>> +
>> +  // update backtrace for old format inode. (see inode_t::decode)
>> +  if (pi->backtrace_version == 0)
>> +    pi->update_backtrace();
>>
>>    mut->auth_pin(in);
>>    mdcache->predirty_journal_parents(mut, &le->metablob, in, 0, PREDIRTY_PRIMARY, 0, follows);
>> diff --git a/src/mds/Server.cc b/src/mds/Server.cc
>> index 466d481..b50169e 100644
>> --- a/src/mds/Server.cc
>> +++ b/src/mds/Server.cc
>> @@ -3207,6 +3207,11 @@ void Server::handle_client_setattr(MDRequest *mdr)
>>
>>    // log + wait
>>    le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
>> +
>> +  // update backtrace for old format inode. (see inode_t::decode)
>> +  if (pi->backtrace_version == 0)
>> +    pi->update_backtrace();
>> +
>>    mdcache->predirty_journal_parents(mdr, &le->metablob, cur, 0, PREDIRTY_PRIMARY, false);
>>    mdcache->journal_dirty_inode(mdr, &le->metablob, cur);
>>
>> diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc
>> index 6886786..f8ec549 100644
>> --- a/src/mds/mdstypes.cc
>> +++ b/src/mds/mdstypes.cc
>> @@ -294,6 +294,8 @@ void inode_t::decode(bufferlist::iterator &p)
>>      ::decode(backtrace_version, p);
>>    if (struct_v >= 7)
>>      ::decode(old_pools, p);
>> +  else
>> +    backtrace_version = 0; // note inode which has no backtrace
>>
>>    DECODE_FINISH(p);
>>  }
>> --
>> 1.8.1.4
>>
>> --
>> 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
> --
> 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	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-21  1:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23  1:42 [PATCH] mds: update backtrace when old format inode is touched Yan, Zheng
2013-08-23 10:09 ` Alexandre Oliva
2013-08-23 11:36   ` Alexandre Oliva
2013-10-16 23:35 ` Gregory Farnum
2013-10-21  1:14   ` Yan, Zheng

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.