Skip to contentSkip to conversation

fs: stub out ioprio_check_cap for !CONFIG_BLOCK

PATCH In review Arnd Bergmann 1 participant 2 messages Jun 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: stub out ioprio_check_cap for !CONFIG_BLOCK

When CONFIG_BLOCK is disabled, we now run into a link error:

fs/aio.o: In function `aio_prep_rw':
aio.c:(.text+0xf68): undefined reference to `ioprio_check_cap'

Since the priorities are unused without block devices, this adds a stub that always returns success.

Fixes d9a08a9e616b ("fs: Add aio iopriority support")

---
Not sure if my assertion is correct, please check that returning zero actually makes sense here.

---
 include/linux/ioprio.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/ioprio.h +7 -0
index 4a28cec49ec3..ccc2a44483b6 100644
@@ -77,6 +77,13 @@ extern int ioprio_best(unsigned short aprio, unsigned short bprio);
 
 extern int set_task_ioprio(struct task_struct *task, int ioprio);
 
+#ifdef CONFIG_BLOCK
 extern int ioprio_check_cap(int ioprio);
+#else
+static inline int ioprio_check_cap(int ioprio)
+{
+	return 0;
+}
+#endif
 
 #endif
Signature · 1 line
2.9.0
#1 lore raw
Quoted 5 lines · Arnd Bergmann

When CONFIG_BLOCK is disabled, we now run into a link error:

fs/aio.o: In function `aio_prep_rw':
aio.c:(.text+0xf68): undefined reference to `ioprio_check_cap'

Quoted 8 lines

Since the priorities are unused without block devices, this adds a stub that always returns success.

Fixes d9a08a9e616b ("fs: Add aio iopriority support")

---
Not sure if my assertion is correct, please check that returning zero actually makes sense here.

Nevermind, I just saw a different patch fixes this in today's linux-next

Arnd