lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 15 Dec 2017 14:56:10 +0800
From:   rongyin <rongyin@...s.chinamobile.com>
To:     viro@...iv.linux.org.uk, kstewart@...uxfoundation.org,
        ebiederm@...ssion.com, trond.myklebust@...marydata.com,
        gregkh@...uxfoundation.org, pombredanne@...b.com,
        keescook@...omium.org
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        rongyin <rongyin@...s.chinamobile.com>
Subject: [PATCH] fs/namespace: __mnt_is_readonly can be boolean

This patch makes __mnt_is_readonly return bool due to this particular
function only using either one or zero as its return value.

No functional change.

Signed-off-by: rongyin <rongyin@...s.chinamobile.com>
---
 fs/namespace.c        | 8 ++++----
 include/linux/mount.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index e158ec6..8a0e90a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -271,13 +271,13 @@ static struct mount *alloc_vfsmnt(const char *name)
  * mnt_want/drop_write() will _keep_ the filesystem
  * r/w.
  */
-int __mnt_is_readonly(struct vfsmount *mnt)
+bool __mnt_is_readonly(struct vfsmount *mnt)
 {
 	if (mnt->mnt_flags & MNT_READONLY)
-		return 1;
+		return true;
 	if (sb_rdonly(mnt->mnt_sb))
-		return 1;
-	return 0;
+		return true;
+	return false;
 }
 EXPORT_SYMBOL_GPL(__mnt_is_readonly);
 
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 45b1f56..037eed5 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -81,7 +81,7 @@ struct vfsmount {
 extern void mntput(struct vfsmount *mnt);
 extern struct vfsmount *mntget(struct vfsmount *mnt);
 extern struct vfsmount *mnt_clone_internal(const struct path *path);
-extern int __mnt_is_readonly(struct vfsmount *mnt);
+extern bool __mnt_is_readonly(struct vfsmount *mnt);
 extern bool mnt_may_suid(struct vfsmount *mnt);
 
 struct path;
-- 
1.8.3.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ