summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
88b329a)
In kernel 4.20 the MS_* flags should only be used for mount
time flags and SB_* flags for checking super_block.s_flags
The MS_* flags have moved to a uapi header
Linux-commit:
e262e32d6bde0f77fb0c95d977482fc872c51996
Test-Parameters: trivial
Change-Id: Ifd64efb16c7795377ece066d01ae04dc004a13ac
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-on: https://review.whamcloud.com/35019
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
+# LC_UAPI_LINUX_MOUNT_H
+#
+# kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
+# vfs: Suppress MS_* flag defs within the kernel ...
+#
+AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
+uapi_linux_mount, [
+ #include <uapi/linux/mount.h>
+],[
+ int x = MS_RDONLY;
+ (void)x;
+],[
+ AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
+ [if MS_RDONLY was moved to uapi/linux/mount.h])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_UAPI_LINUX_MOUNT_H
+
+#
# LC_BIO_INTEGRITY_ENABLED
#
# 4.13 removed bio_integrity_enabled
# LC_BIO_INTEGRITY_ENABLED
#
# 4.13 removed bio_integrity_enabled
# 4.18
LC_INODE_TIMESPEC64
# 4.18
LC_INODE_TIMESPEC64
+ # 5.0
+ LC_UAPI_LINUX_MOUNT_H
+
# kernel patch to extend integrity interface
LC_BIO_INTEGRITY_PREP_FN
# kernel patch to extend integrity interface
LC_BIO_INTEGRITY_PREP_FN
#define IS_NOSEC(inode) (!is_sxid(inode->i_mode))
#endif
#define IS_NOSEC(inode) (!is_sxid(inode->i_mode))
#endif
-#ifndef MS_NOSEC
-static inline void inode_has_no_xattr(struct inode *inode)
-{
- return;
-}
+/*
+ * mount MS_* flags split from superblock SB_* flags
+ * if the SB_* flags are not available use the MS_* flags
+ */
+#if !defined(SB_RDONLY) && defined(MS_RDONLY)
+# define SB_RDONLY MS_RDONLY
+#endif
+#if !defined(SB_ACTIVE) && defined(MS_ACTIVE)
+# define SB_ACTIVE MS_ACTIVE
+#endif
+#if !defined(SB_NOSEC) && defined(MS_NOSEC)
+# define SB_NOSEC MS_NOSEC
+#endif
+#if !defined(SB_POSIXACL) && defined(MS_POSIXACL)
+# define SB_POSIXACL MS_POSIXACL
+#endif
+#if !defined(SB_NODIRATIME) && defined(MS_NODIRATIME)
+# define SB_NODIRATIME MS_NODIRATIME
#endif
#ifndef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
#endif
#ifndef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
return true;
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
return true;
- if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
+ if ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode))
return true;
return false;
return true;
return false;
#include <linux/security.h>
#include <uapi/linux/lustre/lustre_ioctl.h>
#include <linux/security.h>
#include <uapi/linux/lustre/lustre_ioctl.h>
+#ifdef HAVE_UAPI_LINUX_MOUNT_H
+#include <uapi/linux/mount.h>
+#endif
+
#include <lustre_ha.h>
#include <lustre_dlm.h>
#include <lprocfs_status.h>
#include <lustre_ha.h>
#include <lustre_dlm.h>
#include <lprocfs_status.h>
if (OBD_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT))
/* flag mdc connection as lightweight, only used for test
* purpose, use with care */
if (OBD_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT))
/* flag mdc connection as lightweight, only used for test
* purpose, use with care */
- data->ocd_connect_flags |= OBD_CONNECT_LIGHTWEIGHT;
+ data->ocd_connect_flags |= OBD_CONNECT_LIGHTWEIGHT;
- data->ocd_ibits_known = MDS_INODELOCK_FULL;
- data->ocd_version = LUSTRE_VERSION_CODE;
+ data->ocd_ibits_known = MDS_INODELOCK_FULL;
+ data->ocd_version = LUSTRE_VERSION_CODE;
- if (sb->s_flags & MS_RDONLY)
- data->ocd_connect_flags |= OBD_CONNECT_RDONLY;
- if (sbi->ll_flags & LL_SBI_USER_XATTR)
- data->ocd_connect_flags |= OBD_CONNECT_XATTR;
+ if (sb->s_flags & SB_RDONLY)
+ data->ocd_connect_flags |= OBD_CONNECT_RDONLY;
+ if (sbi->ll_flags & LL_SBI_USER_XATTR)
+ data->ocd_connect_flags |= OBD_CONNECT_XATTR;
/* Setting this indicates we correctly support S_NOSEC (See kernel
* commit 9e1f1de02c2275d7172e18dc4e7c2065777611bf)
*/
/* Setting this indicates we correctly support S_NOSEC (See kernel
* commit 9e1f1de02c2275d7172e18dc4e7c2065777611bf)
*/
- sb->s_flags |= MS_NOSEC;
+ sb->s_flags |= SB_NOSEC;
- if (sbi->ll_flags & LL_SBI_FLOCK)
- sbi->ll_fop = &ll_file_operations_flock;
- else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
- sbi->ll_fop = &ll_file_operations;
- else
- sbi->ll_fop = &ll_file_operations_noflock;
+ if (sbi->ll_flags & LL_SBI_FLOCK)
+ sbi->ll_fop = &ll_file_operations_flock;
+ else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
+ sbi->ll_fop = &ll_file_operations;
+ else
+ sbi->ll_fop = &ll_file_operations_noflock;
/* always ping even if server suppress_pings */
if (sbi->ll_flags & LL_SBI_ALWAYS_PING)
/* always ping even if server suppress_pings */
if (sbi->ll_flags & LL_SBI_ALWAYS_PING)
err = obd_connect(NULL, &sbi->ll_md_exp, sbi->ll_md_obd,
&sbi->ll_sb_uuid, data, sbi->ll_cache);
err = obd_connect(NULL, &sbi->ll_md_exp, sbi->ll_md_obd,
&sbi->ll_sb_uuid, data, sbi->ll_cache);
- if (err == -EBUSY) {
- LCONSOLE_ERROR_MSG(0x14f, "An MDT (md %s) is performing "
- "recovery, of which this client is not a "
- "part. Please wait for recovery to complete,"
- " abort, or time out.\n", md);
- GOTO(out, err);
- } else if (err) {
- CERROR("cannot connect to %s: rc = %d\n", md, err);
- GOTO(out, err);
- }
+ if (err == -EBUSY) {
+ LCONSOLE_ERROR_MSG(0x14f, "An MDT (md %s) is performing "
+ "recovery, of which this client is not a "
+ "part. Please wait for recovery to complete,"
+ " abort, or time out.\n", md);
+ GOTO(out, err);
+ } else if (err) {
+ CERROR("cannot connect to %s: rc = %d\n", md, err);
+ GOTO(out, err);
+ }
sbi->ll_md_exp->exp_connect_data = *data;
sbi->ll_md_exp->exp_connect_data = *data;
sbi->ll_namelen = osfs->os_namelen;
sbi->ll_mnt.mnt = current->fs->root.mnt;
sbi->ll_namelen = osfs->os_namelen;
sbi->ll_mnt.mnt = current->fs->root.mnt;
- if ((sbi->ll_flags & LL_SBI_USER_XATTR) &&
- !(data->ocd_connect_flags & OBD_CONNECT_XATTR)) {
- LCONSOLE_INFO("Disabling user_xattr feature because "
- "it is not supported on the server\n");
- sbi->ll_flags &= ~LL_SBI_USER_XATTR;
- }
+ if ((sbi->ll_flags & LL_SBI_USER_XATTR) &&
+ !(data->ocd_connect_flags & OBD_CONNECT_XATTR)) {
+ LCONSOLE_INFO("Disabling user_xattr feature because "
+ "it is not supported on the server\n");
+ sbi->ll_flags &= ~LL_SBI_USER_XATTR;
+ }
- if (data->ocd_connect_flags & OBD_CONNECT_ACL) {
-#ifdef MS_POSIXACL
- sb->s_flags |= MS_POSIXACL;
+ if (data->ocd_connect_flags & OBD_CONNECT_ACL) {
+#ifdef SB_POSIXACL
+ sb->s_flags |= SB_POSIXACL;
- sbi->ll_flags |= LL_SBI_ACL;
- } else {
- LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
-#ifdef MS_POSIXACL
- sb->s_flags &= ~MS_POSIXACL;
+ sbi->ll_flags |= LL_SBI_ACL;
+ } else {
+ LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
+#ifdef SB_POSIXACL
+ sb->s_flags &= ~SB_POSIXACL;
- sbi->ll_flags &= ~LL_SBI_ACL;
- }
+ sbi->ll_flags &= ~LL_SBI_ACL;
+ }
- if (data->ocd_connect_flags & OBD_CONNECT_64BITHASH)
- sbi->ll_flags |= LL_SBI_64BIT_HASH;
+ if (data->ocd_connect_flags & OBD_CONNECT_64BITHASH)
+ sbi->ll_flags |= LL_SBI_64BIT_HASH;
if (data->ocd_connect_flags & OBD_CONNECT_LAYOUTLOCK)
sbi->ll_flags |= LL_SBI_LAYOUT_LOCK;
if (data->ocd_connect_flags & OBD_CONNECT_LAYOUTLOCK)
sbi->ll_flags |= LL_SBI_LAYOUT_LOCK;
struct ll_sb_info *sbi;
ENTRY;
struct ll_sb_info *sbi;
ENTRY;
- /* not init sb ?*/
- if (!(sb->s_flags & MS_ACTIVE))
+ /* not init sb ?*/
+ if (!(sb->s_flags & SB_ACTIVE))
return;
sbi = ll_s2sbi(sb);
return;
sbi = ll_s2sbi(sb);
int ll_remount_fs(struct super_block *sb, int *flags, char *data)
{
int ll_remount_fs(struct super_block *sb, int *flags, char *data)
{
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- char *profilenm = get_profile_name(sb);
- int err;
- __u32 read_only;
-
- if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) {
- read_only = *flags & MS_RDONLY;
- err = obd_set_info_async(NULL, sbi->ll_md_exp,
- sizeof(KEY_READ_ONLY),
- KEY_READ_ONLY, sizeof(read_only),
- &read_only, NULL);
- if (err) {
- LCONSOLE_WARN("Failed to remount %s %s (%d)\n",
- profilenm, read_only ?
- "read-only" : "read-write", err);
- return err;
- }
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ char *profilenm = get_profile_name(sb);
+ int err;
+ __u32 read_only;
+
+ if ((*flags & MS_RDONLY) != (sb->s_flags & SB_RDONLY)) {
+ read_only = *flags & MS_RDONLY;
+ err = obd_set_info_async(NULL, sbi->ll_md_exp,
+ sizeof(KEY_READ_ONLY),
+ KEY_READ_ONLY, sizeof(read_only),
+ &read_only, NULL);
+ if (err) {
+ LCONSOLE_WARN("Failed to remount %s %s (%d)\n",
+ profilenm, read_only ?
+ "read-only" : "read-write", err);
+ return err;
+ }
- if (read_only)
- sb->s_flags |= MS_RDONLY;
- else
- sb->s_flags &= ~MS_RDONLY;
+ if (read_only)
+ sb->s_flags |= SB_RDONLY;
+ else
+ sb->s_flags &= ~SB_RDONLY;
- if (sbi->ll_flags & LL_SBI_VERBOSE)
- LCONSOLE_WARN("Remounted %s %s\n", profilenm,
- read_only ? "read-only" : "read-write");
- }
- return 0;
+ if (sbi->ll_flags & LL_SBI_VERBOSE)
+ LCONSOLE_WARN("Remounted %s %s\n", profilenm,
+ read_only ? "read-only" : "read-write");
+ }
+ return 0;
}
if (it->it_op & IT_OPEN && it->it_flags & FMODE_WRITE &&
}
if (it->it_op & IT_OPEN && it->it_flags & FMODE_WRITE &&
- dentry->d_sb->s_flags & MS_RDONLY)
+ dentry->d_sb->s_flags & SB_RDONLY)
RETURN(ERR_PTR(-EROFS));
if (it->it_op & IT_CREAT)
RETURN(ERR_PTR(-EROFS));
if (it->it_op & IT_CREAT)
it = ll_convert_intent(&nd->intent.open, nd->flags,
(nd->path.mnt->mnt_flags & MNT_READONLY) ||
it = ll_convert_intent(&nd->intent.open, nd->flags,
(nd->path.mnt->mnt_flags & MNT_READONLY) ||
- (nd->path.mnt->mnt_sb->s_flags & MS_RDONLY));
+ (nd->path.mnt->mnt_sb->s_flags & SB_RDONLY));
if (IS_ERR(it))
RETURN((struct dentry *)it);
}
if (IS_ERR(it))
RETURN((struct dentry *)it);
}
sb->s_blocksize_bits = log2(sb->s_blocksize);
sb->s_magic = LUSTRE_SUPER_MAGIC;
sb->s_maxbytes = 0; /* we don't allow file IO on server mountpoints */
sb->s_blocksize_bits = log2(sb->s_blocksize);
sb->s_magic = LUSTRE_SUPER_MAGIC;
sb->s_maxbytes = 0; /* we don't allow file IO on server mountpoints */
- sb->s_flags |= MS_RDONLY;
+ sb->s_flags |= SB_RDONLY;
sb->s_op = &server_ops;
root = new_inode(sb);
sb->s_op = &server_ops;
root = new_inode(sb);
goto out;
statfs_pack(sfs, ksfs);
goto out;
statfs_pack(sfs, ksfs);
- if (unlikely(sb->s_flags & MS_RDONLY))
+ if (unlikely(sb->s_flags & SB_RDONLY))
sfs->os_state |= OS_STATE_READONLY;
sfs->os_state |= osd->od_nonrotational ? OS_STATE_NONROT : 0;
sfs->os_state |= OS_STATE_READONLY;
sfs->os_state |= osd->od_nonrotational ? OS_STATE_NONROT : 0;
struct osd_device *osd = osd_dev(obd->obd_lu_dev);
struct super_block *sb = osd_sb(osd);
struct osd_device *osd = osd_dev(obd->obd_lu_dev);
struct super_block *sb = osd_sb(osd);
- return (osd->od_mnt == NULL || sb->s_flags & MS_RDONLY);
+ return (osd->od_mnt == NULL || sb->s_flags & SB_RDONLY);