[bug report] fs: New zonefs file system

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

 



Hello Damien Le Moal,

The patch 5bba4a0d475a: "fs: New zonefs file system" from Dec 25,
2019, leads to the following static checker warning:

	fs/zonefs/super.c:218 zonefs_inode_setattr()
	error: should you be using S_ISDIR()

fs/zonefs/super.c
   208  static int zonefs_inode_setattr(struct dentry *dentry, struct iattr *iattr)
   209  {
   210          struct inode *inode = d_inode(dentry);
   211          int ret;
   212  
   213          ret = setattr_prepare(dentry, iattr);
   214          if (ret)
   215                  return ret;
   216  
   217          /* Files and sub-directories cannot be created or deleted */
   218          if ((iattr->ia_valid & ATTR_MODE) && (inode->i_mode & S_IFDIR) &&
                                                      ^^^^^^^^^^^^^^^^^^^^^^^
TBH, I don't know what the rules are with these.

   219              (iattr->ia_mode & 0222))
   220                  return -EPERM;
   221  
   222          if (((iattr->ia_valid & ATTR_UID) &&
   223               !uid_eq(iattr->ia_uid, inode->i_uid)) ||
   224              ((iattr->ia_valid & ATTR_GID) &&
   225               !gid_eq(iattr->ia_gid, inode->i_gid))) {
   226                  ret = dquot_transfer(inode, iattr);

regards,
dan carpenter



[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