On 3/11/20 12:14 PM, He Zhe wrote:

On 3/10/20 2:50 PM, Xu, Yanfei wrote:
From: Yanfei Xu <[email protected]>

Fix build failure.

Even though owner member is now made a permanent member of the
rw_semaphore. The rw_semaphore in rwsem-rt.h doesn't have owner
field still.

---------------------Error messages---------------------
|
/buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/fs/aufs/i_op.c:
In function 'au_pin_hdir_set_owner':
|
/buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/fs/aufs/i_op.c:643:45:
error: 'struct rw_semaphore' has no member named 'owner'
|   643 |  atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner,
(long)task);
|       |                                             ^
|   CC      fs/btrfs/zstd.o
|   AR      fs/kernfs/built-in.a
|   CC      arch/x86/kernel/io_delay.o
|   CC      net/ipv6/udplite.o
| make[3]: ***
[/buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/scripts/Makefile.build:265:
fs/aufs/i_op.o] Error 1
| make[3]: *** Waiting for unfinished jobs....
------------------------------------------------------

Signed-off-by: Yanfei Xu <[email protected]>
---
  fs/aufs/i_op.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index ef1e08c7ca10..b6b316b12144 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -640,7 +640,9 @@ int au_pin_hdir_relock(struct au_pin *p)
static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task)
  {
+#if !defined(CONFIG_PREEMPT_RT)
        atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task);
+#endif
This doesn't seem to work as it gives a no-op for RT kernel.

The following diff should work, since rwsem in RT kernel had been implemented 
with rt_mutex.
But I haven't validated it.

diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index ef1e08c7ca10..37b535d19060 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -640,7 +640,7 @@ int au_pin_hdir_relock(struct au_pin *p)
 static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task)
  {
-       atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task);
+       p->hdir->hi_inode->i_rwsem.rtmutex.owner = task;
  }

Good suggestion, and I think "#if !defined(CONFIG_PREEMPT_RT)" should be reserved to avoid compile

failure if someone compiles a kernel without CONFIG_PREEMPT_RT with preempt_rt branchs.

I will send a v2 patch soon.

// Yanfei



 void au_pin_hdir_acquire_nest(struct au_pin *p)


Zhe

  }
void au_pin_hdir_acquire_nest(struct au_pin *p)



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8465): 
https://lists.yoctoproject.org/g/linux-yocto/message/8465
Mute This Topic: https://lists.yoctoproject.org/mt/71852365/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to