On Mon, Nov 25, 2019 at 7:12 AM <hubcap@xxxxxxxxxx> wrote: > > @@ -90,6 +90,8 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode, > new_op->upcall.uid = from_kuid(&init_user_ns, wr->uid); > new_op->upcall.gid = from_kgid(&init_user_ns, wr->gid); > } > + if (new_op->upcall.uid && (ORANGEFS_I(inode)->opened)) > + new_op->upcall.uid = 0; You still can't do this. You can't make it part of the inode state, because the inode is shared across different file descriptors. So you are giving a potentially different file descriptor (that really was opened just for reading) the magical override. What you *should* do is to always use the credentials at open time, and the "can I read or write this" from open time. And regardless of whether you have your own open routine or not, those are always available as "file->f_mode & FMODE_WRITE" and "file->f_cred". If you use those - and pretty much *ONLY* if you use those - you will get things right. Linus