tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 1c1825ed0360fc09f928a4b2e1300f7b718df8dc
commit: d2f54ddb54950df46c7a841b90b57ff83b193d36 [2668/2668] erofs: add fscache context helper functions
config: x86_64-randconfig-121-20250108 (https://download.01.org/0day-ci/archive/20250109/202501092234.VRg7E3V6-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501092234.VRg7E3V6-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501092234.VRg7E3V6-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
fs/erofs/fscache.c:7:22: sparse: sparse: symbol 'erofs_fscache_netfs' was not declared. Should it be static?
fs/erofs/fscache.c:22:33: sparse: sparse: symbol 'erofs_fscache_super_index_def' was not declared. Should it be static?
>> fs/erofs/fscache.c:28:33: sparse: sparse: symbol 'erofs_fscache_inode_object_def' was not declared. Should it be static?
vim +/erofs_fscache_inode_object_def +28 fs/erofs/fscache.c
27
> 28 const struct fscache_cookie_def erofs_fscache_inode_object_def = {
29 .name = "CIFS.uniqueid",
30 .type = FSCACHE_COOKIE_TYPE_DATAFILE,
31 };
32
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
mainline inclusion
from mainline-v6.12-rc3
commit 3e74859ee35edc33a022c3f3971df066ea0ca6b9
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBG2PL
CVE: CVE-2024-56758
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
When we call btrfs_read_folio() to bring a folio uptodate, we unlock the
folio. The result of that is that a different thread can modify the
mapping (like remove it with invalidate) before we call folio_lock().
This results in an invalid page and we need to try again.
In particular, if we are relocating concurrently with aborting a
transaction, this can result in a crash like the following:
BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] SMP
CPU: 76 PID: 1411631 Comm: kworker/u322:5
Workqueue: events_unbound btrfs_reclaim_bgs_work
RIP: 0010:set_page_extent_mapped+0x20/0xb0
RSP: 0018:ffffc900516a7be8 EFLAGS: 00010246
RAX: ffffea009e851d08 RBX: ffffea009e0b1880 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffc900516a7b90 RDI: ffffea009e0b1880
RBP: 0000000003573000 R08: 0000000000000001 R09: ffff88c07fd2f3f0
R10: 0000000000000000 R11: 0000194754b575be R12: 0000000003572000
R13: 0000000003572fff R14: 0000000000100cca R15: 0000000005582fff
FS: 0000000000000000(0000) GS:ffff88c07fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000407d00f002 CR4: 00000000007706f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
? __die+0x78/0xc0
? page_fault_oops+0x2a8/0x3a0
? __switch_to+0x133/0x530
? wq_worker_running+0xa/0x40
? exc_page_fault+0x63/0x130
? asm_exc_page_fault+0x22/0x30
? set_page_extent_mapped+0x20/0xb0
relocate_file_extent_cluster+0x1a7/0x940
relocate_data_extent+0xaf/0x120
relocate_block_group+0x20f/0x480
btrfs_relocate_block_group+0x152/0x320
btrfs_relocate_chunk+0x3d/0x120
btrfs_reclaim_bgs_work+0x2ae/0x4e0
process_scheduled_works+0x184/0x370
worker_thread+0xc6/0x3e0
? blk_add_timer+0xb0/0xb0
kthread+0xae/0xe0
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork+0x2f/0x40
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork_asm+0x11/0x20
</TASK>
This occurs because cleanup_one_transaction() calls
destroy_delalloc_inodes() which calls invalidate_inode_pages2() which
takes the folio_lock before setting mapping to NULL. We fail to check
this, and subsequently call set_extent_mapping(), which assumes that
mapping != NULL (in fact it asserts that in debug mode)
Note that the "fixes" patch here is not the one that introduced the
race (the very first iteration of this code from 2009) but a more recent
change that made this particular crash happen in practice.
Fixes: e7f1326cc24e ("btrfs: set page extent mapped after read_folio in relocate_one_page")
CC: stable(a)vger.kernel.org # 6.1+
Reviewed-by: Qu Wenruo <wqu(a)suse.com>
Signed-off-by: Boris Burkov <boris(a)bur.io>
Signed-off-by: David Sterba <dsterba(a)suse.com>
Conflicts:
fs/btrfs/relocation.c
[The Evolution from Page to Folio]
Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com>
---
fs/btrfs/relocation.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index a67dd544a52d..ea9e847c0e97 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2732,7 +2732,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
PAGE_SIZE);
if (ret)
goto out;
-
+again:
page = find_lock_page(inode->i_mapping, index);
if (!page) {
page_cache_sync_readahead(inode->i_mapping,
@@ -2771,6 +2771,12 @@ static int relocate_file_extent_cluster(struct inode *inode,
}
}
+ if (page->mapping != inode->i_mapping) {
+ unlock_page(page);
+ put_page(page);
+ goto again;
+ }
+
page_start = page_offset(page);
page_end = page_start + PAGE_SIZE - 1;
--
2.39.2
mainline inclusion
from mainline-v6.12-rc3
commit 3e74859ee35edc33a022c3f3971df066ea0ca6b9
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBG2PL
CVE: CVE-2024-56758
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
When we call btrfs_read_folio() to bring a folio uptodate, we unlock the
folio. The result of that is that a different thread can modify the
mapping (like remove it with invalidate) before we call folio_lock().
This results in an invalid page and we need to try again.
In particular, if we are relocating concurrently with aborting a
transaction, this can result in a crash like the following:
BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] SMP
CPU: 76 PID: 1411631 Comm: kworker/u322:5
Workqueue: events_unbound btrfs_reclaim_bgs_work
RIP: 0010:set_page_extent_mapped+0x20/0xb0
RSP: 0018:ffffc900516a7be8 EFLAGS: 00010246
RAX: ffffea009e851d08 RBX: ffffea009e0b1880 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffc900516a7b90 RDI: ffffea009e0b1880
RBP: 0000000003573000 R08: 0000000000000001 R09: ffff88c07fd2f3f0
R10: 0000000000000000 R11: 0000194754b575be R12: 0000000003572000
R13: 0000000003572fff R14: 0000000000100cca R15: 0000000005582fff
FS: 0000000000000000(0000) GS:ffff88c07fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000407d00f002 CR4: 00000000007706f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
? __die+0x78/0xc0
? page_fault_oops+0x2a8/0x3a0
? __switch_to+0x133/0x530
? wq_worker_running+0xa/0x40
? exc_page_fault+0x63/0x130
? asm_exc_page_fault+0x22/0x30
? set_page_extent_mapped+0x20/0xb0
relocate_file_extent_cluster+0x1a7/0x940
relocate_data_extent+0xaf/0x120
relocate_block_group+0x20f/0x480
btrfs_relocate_block_group+0x152/0x320
btrfs_relocate_chunk+0x3d/0x120
btrfs_reclaim_bgs_work+0x2ae/0x4e0
process_scheduled_works+0x184/0x370
worker_thread+0xc6/0x3e0
? blk_add_timer+0xb0/0xb0
kthread+0xae/0xe0
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork+0x2f/0x40
? flush_tlb_kernel_range+0x90/0x90
ret_from_fork_asm+0x11/0x20
</TASK>
This occurs because cleanup_one_transaction() calls
destroy_delalloc_inodes() which calls invalidate_inode_pages2() which
takes the folio_lock before setting mapping to NULL. We fail to check
this, and subsequently call set_extent_mapping(), which assumes that
mapping != NULL (in fact it asserts that in debug mode)
Note that the "fixes" patch here is not the one that introduced the
race (the very first iteration of this code from 2009) but a more recent
change that made this particular crash happen in practice.
Fixes: e7f1326cc24e ("btrfs: set page extent mapped after read_folio in relocate_one_page")
CC: stable(a)vger.kernel.org # 6.1+
Reviewed-by: Qu Wenruo <wqu(a)suse.com>
Signed-off-by: Boris Burkov <boris(a)bur.io>
Signed-off-by: David Sterba <dsterba(a)suse.com>
Conflicts:
fs/btrfs/relocation.c
[The Evolution from Page to Folio]
Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com>
---
fs/btrfs/relocation.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 299eac696eb4..f73920063572 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2931,6 +2931,7 @@ static int relocate_one_page(struct inode *inode, struct file_ra_state *ra,
int ret;
ASSERT(page_index <= last_index);
+again:
page = find_lock_page(inode->i_mapping, page_index);
if (!page) {
page_cache_sync_readahead(inode->i_mapping, ra, NULL,
@@ -2952,6 +2953,11 @@ static int relocate_one_page(struct inode *inode, struct file_ra_state *ra,
ret = -EIO;
goto release_page;
}
+ if (page->mapping != inode->i_mapping) {
+ unlock_page(page);
+ put_page(page);
+ goto again;
+ }
}
/*
--
2.39.2
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 97f98c391a1fd153ae010a2faf73f9e03270da6e
commit: 5f100bc6aabbe30e55cf20af8e163bb6dba3a3aa [1402/1402] block: fix the DISCARD request merge
config: x86_64-buildonly-randconfig-006-20250109 (https://download.01.org/0day-ci/archive/20250109/202501092100.YDIEEEHw-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501092100.YDIEEEHw-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501092100.YDIEEEHw-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> block/blk-merge.c:688:16: warning: no previous prototype for 'blk_try_req_merge' [-Wmissing-prototypes]
688 | enum elv_merge blk_try_req_merge(struct request *req, struct request *next)
| ^~~~~~~~~~~~~~~~~
vim +/blk_try_req_merge +688 block/blk-merge.c
687
> 688 enum elv_merge blk_try_req_merge(struct request *req, struct request *next)
689 {
690 if (blk_discard_mergable(req))
691 return ELEVATOR_DISCARD_MERGE;
692 else if (blk_rq_pos(req) + blk_rq_sectors(req) == blk_rq_pos(next))
693 return ELEVATOR_BACK_MERGE;
694
695 return ELEVATOR_NO_MERGE;
696 }
697
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBGLXT
--------------------------------
A warning was found:
WARNING: CPU: 10 PID: 3486953 at fs/kernfs/file.c:828
CPU: 10 PID: 3486953 Comm: rmdir Kdump: loaded Tainted: G
RIP: 0010:kernfs_should_drain_open_files+0x1a1/0x1b0
RSP: 0018:ffff8881107ef9e0 EFLAGS: 00010202
RAX: 0000000080000002 RBX: ffff888154738c00 RCX: dffffc0000000000
RDX: 0000000000000007 RSI: 0000000000000004 RDI: ffff888154738c04
RBP: ffff888154738c04 R08: ffffffffaf27fa15 R09: ffffed102a8e7180
R10: ffff888154738c07 R11: 0000000000000000 R12: ffff888154738c08
R13: ffff888750f8c000 R14: ffff888750f8c0e8 R15: ffff888154738ca0
FS: 00007f84cd0be740(0000) GS:ffff8887ddc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555f9fbe00c8 CR3: 0000000153eec001 CR4: 0000000000370ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
kernfs_drain+0x15e/0x2f0
__kernfs_remove+0x165/0x300
kernfs_remove_by_name_ns+0x7b/0xc0
cgroup_rm_file+0x154/0x1c0
cgroup_addrm_files+0x1c2/0x1f0
css_clear_dir+0x77/0x110
kill_css+0x4c/0x1b0
cgroup_destroy_locked+0x194/0x380
cgroup_rmdir+0x2a/0x140
It can be explained by:
rmdir echo 1 > cpuset.cpus
kernfs_fop_write_iter // active=0
cgroup_rm_file
kernfs_remove_by_name_ns kernfs_get_active // active=1
__kernfs_remove // active=0x80000002
kernfs_drain cpuset_write_resmask
wait_event
//waiting (active == 0x80000001)
kernfs_break_active_protection
// active = 0x80000001
// continue
kernfs_unbreak_active_protection
// active = 0x80000002
...
kernfs_should_drain_open_files
// warning occurs
kernfs_put_active
This warning is caused by 'kernfs_break_active_protection' when it is
writing to cpuset.cpus, and the cgroup is removed concurrently.
The commit 3a5a6d0c2b03 ("cpuset: don't nest cgroup_mutex inside
get_online_cpus()") made cpuset_hotplug_workfn asynchronous, This change
involves calling flush_work(), which can create a multiple processes
circular locking dependency that involve cgroup_mutex, potentially leading
to a deadlock. To avoid deadlock. the commit 76bb5ab8f6e3 ("cpuset: break
kernfs active protection in cpuset_write_resmask()") added
'kernfs_break_active_protection' in the cpuset_write_resmask. This could
lead to this warning.
After the commit 2125c0034c5d ("cgroup/cpuset: Make cpuset hotplug
processing synchronous"), the cpuset_write_resmask no longer needs to
wait the hotplug to finish, which means that concurrent hotplug and cpuset
operations are no longer possible. Therefore, the deadlock doesn't exist
anymore and it does not have to 'break active protection' now. To fix this
warning, just remove kernfs_break_active_protection operation in the
'cpuset_write_resmask'.
Fixes: bdb2fd7fc56e ("kernfs: Skip kernfs_drain_open_files() more aggressively")
Fixes: 76bb5ab8f6e3 ("cpuset: break kernfs active protection in cpuset_write_resmask()")
Reported-by: Ji Fa <jifa(a)huawei.com>
Signed-off-by: Chen Ridong <chenridong(a)huawei.com>
---
kernel/cgroup/cpuset.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 7ea0a6d005192..53ba804a81603 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -3676,29 +3676,6 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,
int retval = -ENODEV;
buf = strstrip(buf);
-
- /*
- * CPU or memory hotunplug may leave @cs w/o any execution
- * resources, in which case the hotplug code asynchronously updates
- * configuration and transfers all tasks to the nearest ancestor
- * which can execute.
- *
- * As writes to "cpus" or "mems" may restore @cs's execution
- * resources, wait for the previously scheduled operations before
- * proceeding, so that we don't end up keep removing tasks added
- * after execution capability is restored.
- *
- * cpuset_handle_hotplug may call back into cgroup core asynchronously
- * via cgroup_transfer_tasks() and waiting for it from a cgroupfs
- * operation like this one can lead to a deadlock through kernfs
- * active_ref protection. Let's break the protection. Losing the
- * protection is okay as we check whether @cs is online after
- * grabbing cpuset_mutex anyway. This only happens on the legacy
- * hierarchies.
- */
- css_get(&cs->css);
- kernfs_break_active_protection(of->kn);
-
cpus_read_lock();
mutex_lock(&cpuset_mutex);
if (!is_cpuset_online(cs))
@@ -3734,8 +3711,6 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,
out_unlock:
mutex_unlock(&cpuset_mutex);
cpus_read_unlock();
- kernfs_unbreak_active_protection(of->kn);
- css_put(&cs->css);
flush_workqueue(cpuset_migrate_mm_wq);
return retval ?: nbytes;
}
--
2.34.1
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 89cbe2e2a9d5402e079b95f36d33d4669614e0dc
commit: a544f0ba62857476ae73fd4305dbe293b7ee7532 [1799/1799] Add Huawei Intelligent Network Card Driver:hibifur
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250109/202501091220.UhgFHZVc-lkp@…)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501091220.UhgFHZVc-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501091220.UhgFHZVc-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/huawei/hibifur/bifur_main.c:175:5: warning: no previous prototype for function 'bifur_enable_disable_vf_all' [-Wmissing-prototypes]
175 | int bifur_enable_disable_vf_all(bool enable)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_main.c:175:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
175 | int bifur_enable_disable_vf_all(bool enable)
| ^
| static
1 warning generated.
--
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:88:6: warning: no previous prototype for function 'bifur_vf_info_hold' [-Wmissing-prototypes]
88 | void bifur_vf_info_hold(struct bifur_vf_info *dev)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:88:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
88 | void bifur_vf_info_hold(struct bifur_vf_info *dev)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:93:6: warning: no previous prototype for function 'bifur_vf_info_put' [-Wmissing-prototypes]
93 | void bifur_vf_info_put(struct bifur_vf_info *dev)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:93:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
93 | void bifur_vf_info_put(struct bifur_vf_info *dev)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:99:6: warning: no previous prototype for function 'bifur_dev_file_add' [-Wmissing-prototypes]
99 | void bifur_dev_file_add(struct bifur_dev_file_t *dev_file)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:99:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
99 | void bifur_dev_file_add(struct bifur_dev_file_t *dev_file)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:106:6: warning: no previous prototype for function 'bifur_dev_file_del' [-Wmissing-prototypes]
106 | void bifur_dev_file_del(struct bifur_dev_file_t *dev_file)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:106:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
106 | void bifur_dev_file_del(struct bifur_dev_file_t *dev_file)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:113:5: warning: no previous prototype for function 'bifur_proc_open' [-Wmissing-prototypes]
113 | int bifur_proc_open(struct inode *inode, struct file *filp)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:113:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
113 | int bifur_proc_open(struct inode *inode, struct file *filp)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:133:5: warning: no previous prototype for function 'bifur_proc_close' [-Wmissing-prototypes]
133 | int bifur_proc_close(struct inode *inode, struct file *filp)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:133:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
133 | int bifur_proc_close(struct inode *inode, struct file *filp)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:171:5: warning: no previous prototype for function 'bifur_dev_proc_build' [-Wmissing-prototypes]
171 | int bifur_dev_proc_build(struct bifur_vf_info *dev)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:171:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
171 | int bifur_dev_proc_build(struct bifur_vf_info *dev)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:204:5: warning: no previous prototype for function 'bifur_dev_proc_destroy' [-Wmissing-prototypes]
204 | int bifur_dev_proc_destroy(struct bifur_vf_info *dev)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_vf_mgr.c:204:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
204 | int bifur_dev_proc_destroy(struct bifur_vf_info *dev)
| ^
| static
8 warnings generated.
--
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:43:6: warning: no previous prototype for function 'bifur_global_file_del' [-Wmissing-prototypes]
43 | void bifur_global_file_del(struct bifur_proc_file_t *proc_file)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:43:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
43 | void bifur_global_file_del(struct bifur_proc_file_t *proc_file)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:50:5: warning: no previous prototype for function 'bifur_global_dev_close' [-Wmissing-prototypes]
50 | int bifur_global_dev_close(struct inode *inode, struct file *filp)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:50:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
50 | int bifur_global_dev_close(struct inode *inode, struct file *filp)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:62:5: warning: no previous prototype for function 'bifur_global_file_add' [-Wmissing-prototypes]
62 | int bifur_global_file_add(struct bifur_proc_file_t *add_proc_file)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:62:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
62 | int bifur_global_file_add(struct bifur_proc_file_t *add_proc_file)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:83:27: warning: no previous prototype for function 'bifur_alloc_proc_file' [-Wmissing-prototypes]
83 | struct bifur_proc_file_t *bifur_alloc_proc_file(void)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:83:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
83 | struct bifur_proc_file_t *bifur_alloc_proc_file(void)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:95:5: warning: no previous prototype for function 'bifur_global_dev_open' [-Wmissing-prototypes]
95 | int bifur_global_dev_open(struct inode *inode, struct file *filp)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:95:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
95 | int bifur_global_dev_open(struct inode *inode, struct file *filp)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:370:5: warning: no previous prototype for function 'bifur_cmd_exec' [-Wmissing-prototypes]
370 | int bifur_cmd_exec(struct file *file, struct bifur_msg *msg)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:370:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
370 | int bifur_cmd_exec(struct file *file, struct bifur_msg *msg)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:383:5: warning: no previous prototype for function 'bifur_msg_copy_from_usr' [-Wmissing-prototypes]
383 | int bifur_msg_copy_from_usr(const char __user *ubuf, size_t size, struct bifur_msg *usr,
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:383:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
383 | int bifur_msg_copy_from_usr(const char __user *ubuf, size_t size, struct bifur_msg *usr,
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:431:6: warning: no previous prototype for function 'bifur_free_knl_msg_buf' [-Wmissing-prototypes]
431 | void bifur_free_knl_msg_buf(struct bifur_msg *msg)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:431:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
431 | void bifur_free_knl_msg_buf(struct bifur_msg *msg)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:437:5: warning: no previous prototype for function 'bifur_msg_copy_to_usr' [-Wmissing-prototypes]
437 | int bifur_msg_copy_to_usr(struct bifur_msg *usr, struct bifur_msg *knl)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:437:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
437 | int bifur_msg_copy_to_usr(struct bifur_msg *usr, struct bifur_msg *knl)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:457:9: warning: no previous prototype for function 'bifur_file_write' [-Wmissing-prototypes]
457 | ssize_t bifur_file_write(struct file *file, const char __user *ubuf, size_t size, loff_t *pos)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:457:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
457 | ssize_t bifur_file_write(struct file *file, const char __user *ubuf, size_t size, loff_t *pos)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:488:9: warning: no previous prototype for function 'bifur_proc_write' [-Wmissing-prototypes]
488 | ssize_t bifur_proc_write(struct file *file, const char __user *ubuf, size_t size, loff_t *pos)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_pfile.c:488:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
488 | ssize_t bifur_proc_write(struct file *file, const char __user *ubuf, size_t size, loff_t *pos)
| ^
| static
11 warnings generated.
--
>> drivers/net/ethernet/huawei/hibifur/bifur_event.c:257:6: warning: no previous prototype for function 'bifur_notify_vf_link_status' [-Wmissing-prototypes]
257 | void bifur_notify_vf_link_status(struct hinic3_lld_dev *lld_dev, u8 port_id, u16 vf_id,
| ^
drivers/net/ethernet/huawei/hibifur/bifur_event.c:257:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
257 | void bifur_notify_vf_link_status(struct hinic3_lld_dev *lld_dev, u8 port_id, u16 vf_id,
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_event.c:282:6: warning: no previous prototype for function 'bifur_notify_all_vfs_link_changed' [-Wmissing-prototypes]
282 | void bifur_notify_all_vfs_link_changed(struct hinic3_lld_dev *lld_dev, u32 dbdf, u8 link_status)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_event.c:282:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
282 | void bifur_notify_all_vfs_link_changed(struct hinic3_lld_dev *lld_dev, u32 dbdf, u8 link_status)
| ^
| static
>> drivers/net/ethernet/huawei/hibifur/bifur_event.c:341:5: warning: no previous prototype for function 'bifur_net_event_callback' [-Wmissing-prototypes]
341 | int bifur_net_event_callback(struct notifier_block *nb, unsigned long event, void *ptr)
| ^
drivers/net/ethernet/huawei/hibifur/bifur_event.c:341:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
341 | int bifur_net_event_callback(struct notifier_block *nb, unsigned long event, void *ptr)
| ^
| static
3 warnings generated.
vim +/bifur_enable_disable_vf_all +175 drivers/net/ethernet/huawei/hibifur/bifur_main.c
174
> 175 int bifur_enable_disable_vf_all(bool enable)
176 {
177 int err = 0;
178 int num_vfs = enable ? BIFUR_VF_NUM : 0;
179 struct bifur_lld_dev *bifur_dev = NULL;
180 struct bifur_lld_dev *tmp_dev = NULL;
181 struct bifur_adapter *adp = bifur_get_adp();
182 struct list_head *head = &adp->lld_dev_head;
183
184 list_for_each_entry_safe(bifur_dev, tmp_dev, head, list) {
185 if (bifur_dev->pf_type != BIFUR_RESOURCE_PF)
186 continue;
187
188 bifur_dev_hold(bifur_dev);
189 err = bifur_enable_disable_vfs(bifur_dev, num_vfs);
190 bifur_dev_put(bifur_dev);
191 if (err)
192 return err;
193 }
194
195 return 0;
196 }
197
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki