public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugfs: keep the old valid mode value when no explicity specify it
@ 2014-08-28 10:09 Chen LinX
  2014-08-28 15:10 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Chen LinX @ 2014-08-28 10:09 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: yanmin_zhang, Chen, LinX, He, Bo

From: "Chen, LinX" <linx.z.chen@intel.com>

When mount debugfs with no mode specifed after it's mounted, the mount
point mode will change to default mode(0700) even the mount operation was fail,
this will cause some issues like can't get binder info in android. Here we can
keep the old valid mode if no explicity specify the mode value and also change
the mode value even the mount fails if the mode value is specified.

Change-Id: I591ce5328e9589adfc3d7317f04276bf0033202a
Signed-off-by: He, Bo <bo.he@intel.com>
Signed-off-by: Chen, LinX <linx.z.chen@intel.com>
---
 fs/debugfs/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index c7c83ff..f1eb4b9 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -159,7 +159,8 @@ static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
 	kgid_t gid;
 	char *p;
 
-	opts->mode = DEBUGFS_DEFAULT_MODE;
+	if (opts->mode == 0)
+		opts->mode = DEBUGFS_DEFAULT_MODE;
 
 	while ((p = strsep(&data, ",")) != NULL) {
 		if (!*p)
-- 
1.7.9.5


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

end of thread, other threads:[~2014-08-29 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 10:09 [PATCH] debugfs: keep the old valid mode value when no explicity specify it Chen LinX
2014-08-28 15:10 ` Greg KH
2014-08-29  1:30   ` Zhang, Yanmin
2014-08-29 18:24     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox