From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 3/4] configfs: implement committable items
Date: Thu, 26 Nov 2020 02:11:05 +0800 [thread overview]
Message-ID: <202011260250.MUnAHgz2-lkp@intel.com> (raw)
In-Reply-To: <20201125152247.30809-4-brgl@bgdev.pl>
[-- Attachment #1: Type: text/plain, Size: 5338 bytes --]
Hi Bartosz,
I love your patch! Perhaps something to improve:
[auto build test WARNING on hch-configfs/for-next]
[also build test WARNING on linux/master linus/master v5.10-rc5 next-20201125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/configfs-implement-committable-items-and-add-sample-code/20201125-232501
base: git://git.infradead.org/users/hch/configfs.git for-next
config: arm-randconfig-r031-20201125 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9ddc94acfed5f87493359f719d6eb5c259b6bd6d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bartosz-Golaszewski/configfs-implement-committable-items-and-add-sample-code/20201125-232501
git checkout 9ddc94acfed5f87493359f719d6eb5c259b6bd6d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/configfs/dir.c: In function 'configfs_rename':
>> fs/configfs/dir.c:1714:26: warning: variable 'committable_group_sd' set but not used [-Wunused-but-set-variable]
1714 | struct configfs_dirent *committable_group_sd;
| ^~~~~~~~~~~~~~~~~~~~
vim +/committable_group_sd +1714 fs/configfs/dir.c
1707
1708 static int configfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1709 struct inode *new_dir, struct dentry *new_dentry,
1710 unsigned int flags)
1711 {
1712 struct configfs_dirent *sd, *old_parent_sd, *new_parent_sd;
1713 struct dentry *old_parent_dentry, *new_parent_dentry;
> 1714 struct configfs_dirent *committable_group_sd;
1715 struct dentry *committable_group_dentry;
1716 struct config_item *committable_group_item, *item, *new_parent_item;
1717 struct configfs_subsystem *committable_group_subsys;
1718 struct configfs_group_operations *committable_group_ops;
1719 int ret = 0;
1720
1721 if (flags)
1722 return -EINVAL;
1723
1724 old_parent_dentry = old_dentry->d_parent;
1725 new_parent_dentry = new_dentry->d_parent;
1726
1727 sd = old_dentry->d_fsdata;
1728 old_parent_sd = old_dentry->d_parent->d_fsdata;
1729 new_parent_sd = new_dentry->d_parent->d_fsdata;
1730
1731 if (!old_parent_sd || !new_parent_sd)
1732 return -EPERM;
1733
1734 /*
1735 * Renaming must always be between a 'pending' and a 'live' group and
1736 * both need to have the same parent.
1737 */
1738 if (!((old_parent_sd->s_type & CONFIGFS_GROUP_PENDING) &&
1739 (new_parent_sd->s_type & CONFIGFS_GROUP_LIVE)) &&
1740 !((old_parent_sd->s_type & CONFIGFS_GROUP_LIVE) &&
1741 (new_parent_sd->s_type & CONFIGFS_GROUP_PENDING)))
1742 return -EPERM;
1743
1744 if (old_parent_dentry->d_parent != new_parent_dentry->d_parent)
1745 return -EPERM;
1746
1747 committable_group_dentry = old_parent_dentry->d_parent;
1748 committable_group_sd = committable_group_dentry->d_fsdata;
1749 /*
1750 * Grab a reference to the committable group for the duration of
1751 * this function.
1752 */
1753 committable_group_item =
1754 configfs_get_config_item(committable_group_dentry);
1755 committable_group_subsys =
1756 to_config_group(committable_group_item)->cg_subsys;
1757 committable_group_ops = committable_group_item->ci_type->ct_group_ops;
1758
1759 item = sd->s_element;
1760 new_parent_item = new_parent_sd->s_element;
1761
1762 if (WARN_ON(!is_committable_group(committable_group_item))) {
1763 /* This would be a result of a programming error in configfs. */
1764 config_item_put(committable_group_item);
1765 return -EPERM;
1766 }
1767
1768 mutex_lock(&committable_group_subsys->su_mutex);
1769 spin_lock(&configfs_dirent_lock);
1770
1771 if ((old_parent_sd->s_type & CONFIGFS_GROUP_PENDING) &&
1772 (new_parent_sd->s_type & CONFIGFS_GROUP_LIVE))
1773 ret = committable_group_ops->commit_item(item);
1774 else
1775 ret = committable_group_ops->uncommit_item(item);
1776 if (ret)
1777 goto out;
1778
1779 new_dentry->d_fsdata = sd;
1780 list_move(&sd->s_sibling, &new_parent_sd->s_children);
1781 item->ci_parent = new_parent_item;
1782 d_move(old_dentry, new_dentry);
1783
1784 out:
1785 spin_unlock(&configfs_dirent_lock);
1786 mutex_unlock(&committable_group_subsys->su_mutex);
1787 config_item_put(committable_group_item);
1788
1789 return ret;
1790 }
1791
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34449 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Joel Becker <jlbec@evilplan.org>, Christoph Hellwig <hch@lst.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 3/4] configfs: implement committable items
Date: Thu, 26 Nov 2020 02:11:05 +0800 [thread overview]
Message-ID: <202011260250.MUnAHgz2-lkp@intel.com> (raw)
In-Reply-To: <20201125152247.30809-4-brgl@bgdev.pl>
[-- Attachment #1: Type: text/plain, Size: 5211 bytes --]
Hi Bartosz,
I love your patch! Perhaps something to improve:
[auto build test WARNING on hch-configfs/for-next]
[also build test WARNING on linux/master linus/master v5.10-rc5 next-20201125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/configfs-implement-committable-items-and-add-sample-code/20201125-232501
base: git://git.infradead.org/users/hch/configfs.git for-next
config: arm-randconfig-r031-20201125 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9ddc94acfed5f87493359f719d6eb5c259b6bd6d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bartosz-Golaszewski/configfs-implement-committable-items-and-add-sample-code/20201125-232501
git checkout 9ddc94acfed5f87493359f719d6eb5c259b6bd6d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/configfs/dir.c: In function 'configfs_rename':
>> fs/configfs/dir.c:1714:26: warning: variable 'committable_group_sd' set but not used [-Wunused-but-set-variable]
1714 | struct configfs_dirent *committable_group_sd;
| ^~~~~~~~~~~~~~~~~~~~
vim +/committable_group_sd +1714 fs/configfs/dir.c
1707
1708 static int configfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1709 struct inode *new_dir, struct dentry *new_dentry,
1710 unsigned int flags)
1711 {
1712 struct configfs_dirent *sd, *old_parent_sd, *new_parent_sd;
1713 struct dentry *old_parent_dentry, *new_parent_dentry;
> 1714 struct configfs_dirent *committable_group_sd;
1715 struct dentry *committable_group_dentry;
1716 struct config_item *committable_group_item, *item, *new_parent_item;
1717 struct configfs_subsystem *committable_group_subsys;
1718 struct configfs_group_operations *committable_group_ops;
1719 int ret = 0;
1720
1721 if (flags)
1722 return -EINVAL;
1723
1724 old_parent_dentry = old_dentry->d_parent;
1725 new_parent_dentry = new_dentry->d_parent;
1726
1727 sd = old_dentry->d_fsdata;
1728 old_parent_sd = old_dentry->d_parent->d_fsdata;
1729 new_parent_sd = new_dentry->d_parent->d_fsdata;
1730
1731 if (!old_parent_sd || !new_parent_sd)
1732 return -EPERM;
1733
1734 /*
1735 * Renaming must always be between a 'pending' and a 'live' group and
1736 * both need to have the same parent.
1737 */
1738 if (!((old_parent_sd->s_type & CONFIGFS_GROUP_PENDING) &&
1739 (new_parent_sd->s_type & CONFIGFS_GROUP_LIVE)) &&
1740 !((old_parent_sd->s_type & CONFIGFS_GROUP_LIVE) &&
1741 (new_parent_sd->s_type & CONFIGFS_GROUP_PENDING)))
1742 return -EPERM;
1743
1744 if (old_parent_dentry->d_parent != new_parent_dentry->d_parent)
1745 return -EPERM;
1746
1747 committable_group_dentry = old_parent_dentry->d_parent;
1748 committable_group_sd = committable_group_dentry->d_fsdata;
1749 /*
1750 * Grab a reference to the committable group for the duration of
1751 * this function.
1752 */
1753 committable_group_item =
1754 configfs_get_config_item(committable_group_dentry);
1755 committable_group_subsys =
1756 to_config_group(committable_group_item)->cg_subsys;
1757 committable_group_ops = committable_group_item->ci_type->ct_group_ops;
1758
1759 item = sd->s_element;
1760 new_parent_item = new_parent_sd->s_element;
1761
1762 if (WARN_ON(!is_committable_group(committable_group_item))) {
1763 /* This would be a result of a programming error in configfs. */
1764 config_item_put(committable_group_item);
1765 return -EPERM;
1766 }
1767
1768 mutex_lock(&committable_group_subsys->su_mutex);
1769 spin_lock(&configfs_dirent_lock);
1770
1771 if ((old_parent_sd->s_type & CONFIGFS_GROUP_PENDING) &&
1772 (new_parent_sd->s_type & CONFIGFS_GROUP_LIVE))
1773 ret = committable_group_ops->commit_item(item);
1774 else
1775 ret = committable_group_ops->uncommit_item(item);
1776 if (ret)
1777 goto out;
1778
1779 new_dentry->d_fsdata = sd;
1780 list_move(&sd->s_sibling, &new_parent_sd->s_children);
1781 item->ci_parent = new_parent_item;
1782 d_move(old_dentry, new_dentry);
1783
1784 out:
1785 spin_unlock(&configfs_dirent_lock);
1786 mutex_unlock(&committable_group_subsys->su_mutex);
1787 config_item_put(committable_group_item);
1788
1789 return ret;
1790 }
1791
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34449 bytes --]
next prev parent reply other threads:[~2020-11-25 18:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 15:22 [PATCH 0/4] configfs: implement committable items and add sample code Bartosz Golaszewski
2020-11-25 15:22 ` [PATCH 1/4] configfs: increase the item name length Bartosz Golaszewski
2020-11-25 15:22 ` [PATCH 2/4] configfs: use BIT() for internal flags Bartosz Golaszewski
2020-11-25 15:22 ` [PATCH 3/4] configfs: implement committable items Bartosz Golaszewski
2020-11-25 18:11 ` kernel test robot [this message]
2020-11-25 18:11 ` kernel test robot
2021-01-13 23:46 ` Joel Becker
2021-01-14 8:40 ` Bartosz Golaszewski
2021-01-14 14:19 ` Bartosz Golaszewski
2020-11-25 15:22 ` [PATCH 4/4] samples: configfs: add a committable group Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011260250.MUnAHgz2-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.