[vfs:M8 9/31] fs/fs_context.c:66:2: warning: enumeration value 'FS_CONTEXT_FOR_SUBMOUNT' not handled in switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git M8
head:   5e7877be25361d1d622dde6656f54f4d7a5afe6e
commit: d186d50786cb550af6bae5b33fbe762450fdd581 [9/31] vfs: Introduce the basic header for the new mount API's filesystem context
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout d186d50786cb550af6bae5b33fbe762450fdd581
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   fs/fs_context.c: In function 'vfs_new_fs_context':
>> fs/fs_context.c:66:2: warning: enumeration value 'FS_CONTEXT_FOR_SUBMOUNT' not handled in switch [-Wswitch]
     switch (purpose) {
     ^~~~~~
>> fs/fs_context.c:66:2: warning: enumeration value 'FS_CONTEXT_FOR_ROOT_MOUNT' not handled in switch [-Wswitch]

vim +/FS_CONTEXT_FOR_SUBMOUNT +66 fs/fs_context.c

d4ea7f68 Al Viro 2018-11-04  33  
d4ea7f68 Al Viro 2018-11-04  34  /**
d4ea7f68 Al Viro 2018-11-04  35   * vfs_new_fs_context - Create a filesystem context.
d4ea7f68 Al Viro 2018-11-04  36   * @fs_type: The filesystem type.
d4ea7f68 Al Viro 2018-11-04  37   * @reference: The dentry from which this one derives (or NULL)
d4ea7f68 Al Viro 2018-11-04  38   * @sb_flags: Filesystem/superblock flags (SB_*)
d4ea7f68 Al Viro 2018-11-04  39   * @sb_flags_mask: Applicable members of @sb_flags
d4ea7f68 Al Viro 2018-11-04  40   * @purpose: The purpose that this configuration shall be used for.
d4ea7f68 Al Viro 2018-11-04  41   *
d4ea7f68 Al Viro 2018-11-04  42   * Open a filesystem and create a mount context.  The mount context is
d4ea7f68 Al Viro 2018-11-04  43   * initialised with the supplied flags and, if a submount/automount from
d4ea7f68 Al Viro 2018-11-04  44   * another superblock (referred to by @reference) is supplied, may have
d4ea7f68 Al Viro 2018-11-04  45   * parameters such as namespaces copied across from that superblock.
d4ea7f68 Al Viro 2018-11-04  46   */
d4ea7f68 Al Viro 2018-11-04  47  struct fs_context *vfs_new_fs_context(struct file_system_type *fs_type,
d4ea7f68 Al Viro 2018-11-04  48  				      struct dentry *reference,
d4ea7f68 Al Viro 2018-11-04  49  				      unsigned int sb_flags,
d4ea7f68 Al Viro 2018-11-04  50  				      unsigned int sb_flags_mask,
d4ea7f68 Al Viro 2018-11-04  51  				      enum fs_context_purpose purpose)
d4ea7f68 Al Viro 2018-11-04  52  {
d4ea7f68 Al Viro 2018-11-04  53  	struct fs_context *fc;
d4ea7f68 Al Viro 2018-11-04  54  	int ret = -ENOMEM;
d4ea7f68 Al Viro 2018-11-04  55  
d4ea7f68 Al Viro 2018-11-04  56  	fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL);
d4ea7f68 Al Viro 2018-11-04  57  	if (!fc)
d4ea7f68 Al Viro 2018-11-04  58  		return ERR_PTR(-ENOMEM);
d4ea7f68 Al Viro 2018-11-04  59  
d4ea7f68 Al Viro 2018-11-04  60  	fc->purpose	= purpose;
d4ea7f68 Al Viro 2018-11-04  61  	fc->sb_flags	= sb_flags;
d4ea7f68 Al Viro 2018-11-04  62  	fc->sb_flags_mask = sb_flags_mask;
d4ea7f68 Al Viro 2018-11-04  63  	fc->fs_type	= get_filesystem(fs_type);
d4ea7f68 Al Viro 2018-11-04  64  	fc->cred	= get_current_cred();
d4ea7f68 Al Viro 2018-11-04  65  
d4ea7f68 Al Viro 2018-11-04 @66  	switch (purpose) {
d4ea7f68 Al Viro 2018-11-04  67  	case FS_CONTEXT_FOR_KERNEL_MOUNT:
d4ea7f68 Al Viro 2018-11-04  68  		fc->sb_flags |= SB_KERNMOUNT;
d4ea7f68 Al Viro 2018-11-04  69  		/* Fallthrough */
d4ea7f68 Al Viro 2018-11-04  70  	case FS_CONTEXT_FOR_USER_MOUNT:
d4ea7f68 Al Viro 2018-11-04  71  		fc->user_ns = get_user_ns(fc->cred->user_ns);
d4ea7f68 Al Viro 2018-11-04  72  		fc->net_ns = get_net(current->nsproxy->net_ns);
d4ea7f68 Al Viro 2018-11-04  73  		break;
0a21c624 Al Viro 2018-11-04  74  	case FS_CONTEXT_FOR_RECONFIGURE:
0a21c624 Al Viro 2018-11-04  75  	case FS_CONTEXT_FOR_UMOUNT:
0a21c624 Al Viro 2018-11-04  76  	case FS_CONTEXT_FOR_EMERGENCY_RO:
0a21c624 Al Viro 2018-11-04  77  		/* We don't pin any namespaces as the superblock's
0a21c624 Al Viro 2018-11-04  78  		 * subscriptions cannot be changed at this point.
0a21c624 Al Viro 2018-11-04  79  		 */
0a21c624 Al Viro 2018-11-04  80  		atomic_inc(&reference->d_sb->s_active);
0a21c624 Al Viro 2018-11-04  81  		fc->root = dget(reference);
0a21c624 Al Viro 2018-11-04  82  		break;
d4ea7f68 Al Viro 2018-11-04  83  	}
d4ea7f68 Al Viro 2018-11-04  84  
d4ea7f68 Al Viro 2018-11-04  85  	ret = legacy_init_fs_context(fc, reference);
d4ea7f68 Al Viro 2018-11-04  86  	if (ret < 0)
d4ea7f68 Al Viro 2018-11-04  87  		goto err_fc;
d4ea7f68 Al Viro 2018-11-04  88  	fc->need_free = true;
d4ea7f68 Al Viro 2018-11-04  89  	return fc;
d4ea7f68 Al Viro 2018-11-04  90  
d4ea7f68 Al Viro 2018-11-04  91  err_fc:
d4ea7f68 Al Viro 2018-11-04  92  	put_fs_context(fc);
d4ea7f68 Al Viro 2018-11-04  93  	return ERR_PTR(ret);
d4ea7f68 Al Viro 2018-11-04  94  }
d4ea7f68 Al Viro 2018-11-04  95  EXPORT_SYMBOL(vfs_new_fs_context);
d4ea7f68 Al Viro 2018-11-04  96  

:::::: The code at line 66 was first introduced by commit
:::::: d4ea7f68ae3c23c9442e2f6ff821aede7b8435d9 introduce fs_context, switch vfs_kern_mount() to it.

:::::: TO: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
:::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux