Skip to contentSkip to conversation

cgroup: fix reverse unlock sequence in cgroup_get_sb

PATCH In review Xiaotian Feng 9 participants 23 messages Jul 21, 2009 – Jul 22, 2009 8 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: fix reverse unlock sequence in cgroup_get_sb

In cgroup_get_sb, the lock sequence is:

	mutex_lock(&inode->i_mutex);
	mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
	mutex_unlock(&cgroup->mutex);
	mutex_unlock(&inode->i_mutex);
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 		BUG_ON(root->number_of_cgroups != 1);
 
 		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
 		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
 	}
 
 	simple_set_mnt(mnt, sb);
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 1248171926-20232-1-git-send-email-dfeng-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

Acked-by
#2 lore raw
Quoted 17 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

	mutex_lock(&inode->i_mutex);
	mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
	mutex_unlock(&cgroup->mutex);
	mutex_unlock(&inode->i_mutex);
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 8 lines
kernel/cgroup.c +1 -1
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 		BUG_ON(root->number_of_cgroups != 1);
 
 		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
 		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
 	}
 

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

Signature · 1 line
	Balbir
Acked-by
#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:
       mutex_lock(&inode->i_mutex);
       mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Quoted 4 lines

       mutex_unlock(&cgroup->mutex);
       mutex_unlock(&inode->i_mutex);

Paul

Acked-by on v1 1/1
#4 lore raw
In reply to Xiaotian Feng
Quoted 17 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

	mutex_lock(&inode->i_mutex);
	mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
	mutex_unlock(&cgroup->mutex);
	mutex_unlock(&inode->i_mutex);
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 8 lines
kernel/cgroup.c +1 -1
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 		BUG_ON(root->number_of_cgroups != 1);
 
 		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
 		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
 	}
 

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

Signature · 1 line
	Balbir

A message that is not in the archive (sent off-list or not yet received): 20090721111019.GV24157-SINUvgVNF2CyUtPGxGje5AC/[email protected]

#6 lore raw
Quoted 21 lines · Balbir Singh
Quoted 19 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

	mutex_lock(&inode->i_mutex);
	mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
	mutex_unlock(&cgroup->mutex);
	mutex_unlock(&inode->i_mutex);
---
  kernel/cgroup.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
  		BUG_ON(root->number_of_cgroups != 1);
 
Quoted 9 lines

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 6 lines
kernel/cgroup.c +1 -1
  		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
  		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
  	}
 

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

Yep, thank you very much:-)

Quoted 4 lines
#7 lore raw
In reply to a message not in the archive

2009/7/21, Balbir Singh <[email protected]>:

Quoted 30 lines · Xiaotian Feng

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type

Quoted 18 lines

In cgroup_get_sb, the lock sequence is:

      mutex_lock(&inode->i_mutex);
      mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
      mutex_unlock(&cgroup->mutex);
      mutex_unlock(&inode->i_mutex);
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type

*fs_type,

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 8 lines
kernel/cgroup.c +1 -1
              BUG_ON(root->number_of_cgroups != 1);
 
              cgroup_populate_dir(root_cgrp);
-             mutex_unlock(&inode->i_mutex);
              mutex_unlock(&cgroup_mutex);
+             mutex_unlock(&inode->i_mutex);
      }
 
Quoted 4 lines

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

--
Li Zefan

#8 lore raw
Quoted 34 lines · Zefan Li

2009/7/21, Balbir Singh <[email protected]>:

Quoted 33 lines · Xiaotian Feng

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type

Quoted 18 lines

In cgroup_get_sb, the lock sequence is:

      mutex_lock(&inode->i_mutex);
      mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
      mutex_unlock(&cgroup->mutex);
      mutex_unlock(&inode->i_mutex);
---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type

*fs_type,

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 8 lines
kernel/cgroup.c +1 -1
              BUG_ON(root->number_of_cgroups != 1);
 
              cgroup_populate_dir(root_cgrp);
-             mutex_unlock(&inode->i_mutex);
              mutex_unlock(&cgroup_mutex);
+             mutex_unlock(&inode->i_mutex);
      }
 

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

Quoted 9 lines
Quoted 1 line

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

Li, Consider the following

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

code block

unlock(B)

What protects code block? lock B? Is that the intention?

Signature · 1 line
	Balbir

A message that is not in the archive (sent off-list or not yet received): 20090721120106.GW24157-SINUvgVNF2CyUtPGxGje5AC/[email protected]

#10 lore raw
Quoted 12 lines · Balbir Singh

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 7 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

An "unsuspecting programmer" shouldn't be adding code to multi-threaded routines without thoroughly understanding the locking.

I guess there's no harm in this patch, but as Li says, it doesn't really change anything.

Paul

#11 lore raw
In reply to a message not in the archive
Quoted 27 lines
Quoted 11 lines
Quoted 4 lines

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

Li, Consider the following

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 7 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

I won't worry about that. If unlock order is a concern, we should have taught lockdep to detect it.

Here's a reply from Linus on this issue:

	http://lkml.org/lkml/2008/10/8/150
#12 lore raw
In reply to Balbir Singh
Quoted 12 lines · Balbir Singh

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 7 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

An "unsuspecting programmer" shouldn't be adding code to multi-threaded routines without thoroughly understanding the locking.

I guess there's no harm in this patch, but as Li says, it doesn't really change anything.

Paul

A message that is not in the archive (sent off-list or not yet received): 6599ad830907210834y30e7d57aj978898a300a447d0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#14 lore raw
Quoted 15 lines · * [email protected]…
Quoted 14 lines · Balbir Singh

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

code block

Quoted 9 lines
Quoted 5 lines

unlock(B)

What protects code block? lock B? Is that the intention?

An "unsuspecting programmer" shouldn't be adding code to multi-threaded routines without thoroughly understanding the locking.

Agreed, but why leave behind places for people to do so. There is the consistency factor as well, see below.

Quoted 3 lines

I guess there's no harm in this patch, but as Li says, it doesn't really change anything.

Well all the other places do it right in the same routine.

Signature · 1 line
	Balbir
#15 lore raw
In reply to Paul Menage
Quoted 15 lines · * [email protected] <[email protected]> [2009-07-21 08:34:51]:
Quoted 14 lines · Balbir Singh

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

code block

Quoted 9 lines
Quoted 5 lines

unlock(B)

What protects code block? lock B? Is that the intention?

An "unsuspecting programmer" shouldn't be adding code to multi-threaded routines without thoroughly understanding the locking.

Agreed, but why leave behind places for people to do so. There is the consistency factor as well, see below.

Quoted 3 lines

I guess there's no harm in this patch, but as Li says, it doesn't really change anything.

Well all the other places do it right in the same routine.

Signature · 1 line
	Balbir
#16 lore raw
In reply to Balbir Singh
Quoted 27 lines
Quoted 11 lines
Quoted 4 lines

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

Li, Consider the following

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 7 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

I won't worry about that. If unlock order is a concern, we should have taught lockdep to detect it.

Here's a reply from Linus on this issue:

	http://lkml.org/lkml/2008/10/8/150

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw
Quoted 35 lines · Li Zefan
Quoted 26 lines
Quoted 12 lines
Quoted 5 lines

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

Li, Consider the following

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 8 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

Quoted 7 lines

I won't worry about that. If unlock order is a concern, we should have taught lockdep to detect it.

Here's a reply from Linus on this issue:

	http://lkml.org/lkml/2008/10/8/150

OK, this patch is trivial. Just for consistency with previous unlock sequence:-)

author
#19 lore raw
In reply to Li Zefan
Quoted 35 lines · Li Zefan
Quoted 26 lines
Quoted 12 lines
Quoted 5 lines

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

No, the unlock order is irrelevant. It's the lock order that matters. So this patch
fixes nothing.

Xiaotian, you didn't run into deadlock, did you?

Li, Consider the following

lock(A)
lock(B)
unlock(A)
unlock(B)

Tomorrow if a unsuspecting programmer does this

lock(A)
lock(B)
unlock(A)

Quoted 8 lines

code block

unlock(B)

What protects code block? lock B? Is that the intention?

Quoted 7 lines

I won't worry about that. If unlock order is a concern, we should have taught lockdep to detect it.

Here's a reply from Linus on this issue:

	http://lkml.org/lkml/2008/10/8/150

OK, this patch is trivial. Just for consistency with previous unlock sequence:-)

author
#20 lore raw
In reply to Balbir Singh
Quoted 21 lines · Balbir Singh
Quoted 19 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

	mutex_lock(&inode->i_mutex);
	mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:
	mutex_unlock(&cgroup->mutex);
	mutex_unlock(&inode->i_mutex);
---
  kernel/cgroup.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +0 -0
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
  		BUG_ON(root->number_of_cgroups != 1);
 
Quoted 9 lines

kernel/cgroup.c static int cgroup_get_sb(struct file_system_type *fs_type, · line 1146

Quoted 6 lines
kernel/cgroup.c +1 -1
  		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
  		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
  	}
 

Seems reasonable to me. You might also want to mention that elsewhere the sequence is unlock cgroup_mutex followed by inode->i_mutex.

Yep, thank you very much:-)

Quoted 4 lines
Acked-by on v1 1/1
#21 lore raw
In reply to Xiaotian Feng
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:
       mutex_lock(&inode->i_mutex);
       mutex_lock(&cgroup->mutex);
so the last unlock sequence should be:

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Quoted 4 lines

       mutex_unlock(&cgroup->mutex);
       mutex_unlock(&inode->i_mutex);

Paul

A message that is not in the archive (sent off-list or not yet received): 6599ad830907210903q7206cac2l83a9139d19c5e1a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#23 lore raw
Quoted 6 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

        mutex_lock(&inode->i_mutex);
        mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Quoted 6 lines

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

Quoted 8 lines
Quoted 4 lines
        mutex_unlock(&cgroup->mutex);
        mutex_unlock(&inode->i_mutex);

Paul

From ff96b0dc4a5f06a0e5b7f8dfa5df2b93e993302c Mon Sep 17 00:00:00 2001
From: Xiaotian Feng <[email protected]>
Date: Tue, 21 Jul 2009 18:06:43 +0800
Subject: [PATCH] cgroup: make unlock sequence in cgroup_get_sb consistent

Make the last unlock sequence consistent with previous unlock sequeue.

---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 		BUG_ON(root->number_of_cgroups != 1);
 
 		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
 		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
 	}
 
 	simple_set_mnt(mnt, sb);
Signature · 1 line
1.6.2.5

_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

author
#24 lore raw
In reply to Paul Menage
Quoted 6 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

        mutex_lock(&inode->i_mutex);
        mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Quoted 6 lines

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

Quoted 10 lines
Quoted 4 lines
        mutex_unlock(&cgroup->mutex);
        mutex_unlock(&inode->i_mutex);

Paul

From ff96b0dc4a5f06a0e5b7f8dfa5df2b93e993302c Mon Sep 17 00:00:00 2001

From: Xiaotian Feng <[email protected]>
Date: Tue, 21 Jul 2009 18:06:43 +0800
Subject: [PATCH] cgroup: make unlock sequence in cgroup_get_sb consistent

Make the last unlock sequence consistent with previous unlock sequeue.

---
 kernel/cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/cgroup.c +1 -1
index 3737a68..11ef162 100644
@@ -1140,8 +1140,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 		BUG_ON(root->number_of_cgroups != 1);
 
 		cgroup_populate_dir(root_cgrp);
-		mutex_unlock(&inode->i_mutex);
 		mutex_unlock(&cgroup_mutex);
+		mutex_unlock(&inode->i_mutex);
 	}
 
 	simple_set_mnt(mnt, sb);
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by Balbir ... Acked-by Paul ...
#26 lore raw
Quoted 9 lines · Danny Feng
Quoted 8 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

        mutex_lock(&inode->i_mutex);
        mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Make this "so for consistency the last ..." ?

Quoted 8 lines
Quoted 4 lines

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

As far as it's not declared as a fix, I has no objection to this patch.

Please always inline the patch in the mail body. And when resending the patch, add the acked-by you collected in it:

Acked-by Balbir ...
Acked-by Paul ...
Signed-off-by Xiaotian ...

You may resend the patch to Andrew Morton, who picks up cgroup patches, otherwise the patch may be overlooked.

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
        mutex_unlock(&cgroup->mutex);
        mutex_unlock(&inode->i_mutex);

Paul

Acked-by Balbir ... Acked-by Paul ...
#27 lore raw
In reply to Danny Feng
Quoted 9 lines · Danny Feng
Quoted 8 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

        mutex_lock(&inode->i_mutex);
        mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Make this "so for consistency the last ..." ?

Quoted 8 lines
Quoted 4 lines

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

As far as it's not declared as a fix, I has no objection to this patch.

Please always inline the patch in the mail body. And when resending the patch, add the acked-by you collected in it:

Acked-by Balbir ...
Acked-by Paul ...
Signed-off-by Xiaotian ...

You may resend the patch to Andrew Morton, who picks up cgroup patches, otherwise the patch may be overlooked.

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
        mutex_unlock(&cgroup->mutex);
        mutex_unlock(&inode->i_mutex);

Paul

A message that is not in the archive (sent off-list or not yet received): [email protected]

#29 lore raw
Quoted 23 lines · Li Zefan
Quoted 6 lines · Danny Feng
Quoted 5 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

         mutex_lock(&inode->i_mutex);
         mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Quoted 9 lines
Quoted 6 lines

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

As far as it's not declared as a fix, I has no objection to this patch.

Please always inline the patch in the mail body. And when resending the patch, add the acked-by you collected in it:

Quoted 7 lines
Acked-by Balbir ...
Acked-by Paul ...
Signed-off-by Xiaotian ...

You may resend the patch to Andrew Morton, who picks up cgroup patches, otherwise the patch may be overlooked.

Got it, thank you very much.

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
         mutex_unlock(&cgroup->mutex);
         mutex_unlock(&inode->i_mutex);

Paul

author
#30 lore raw
In reply to Li Zefan
Quoted 23 lines · Li Zefan
Quoted 6 lines · Danny Feng
Quoted 5 lines · Paul Menage
Quoted 4 lines · Xiaotian Feng

In cgroup_get_sb, the lock sequence is:

         mutex_lock(&inode->i_mutex);
         mutex_lock(&cgroup->mutex);

so the last unlock sequence should be:

Quoted 9 lines
Quoted 6 lines

Make this "so for consistency the last ..." ?

Maybe make the patch title "Make unlock sequence in cgroup_get_sb consistent" so someone looking through the change logs for fixes to backport doesn't wrongly thing that this fixes any bug"?

Yep, this is a trivial patch. Modified following your suggestion, thank you.

As far as it's not declared as a fix, I has no objection to this patch.

Please always inline the patch in the mail body. And when resending the patch, add the acked-by you collected in it:

Quoted 7 lines
Acked-by Balbir ...
Acked-by Paul ...
Signed-off-by Xiaotian ...

You may resend the patch to Andrew Morton, who picks up cgroup patches, otherwise the patch may be overlooked.

Got it, thank you very much.

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
         mutex_unlock(&cgroup->mutex);
         mutex_unlock(&inode->i_mutex);

Paul