lkml.org 
[lkml]   [2022]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [regression, bisected] Bug 216738 - Adding O_APPEND to O_RDWR with fcntl(fd, F_SETFL) does not work on overlayfs
On Thu, 24 Nov 2022 at 18:03, Al Viro <viro@zeniv.linux.org.uk> wrote:

> So basically we have this
> static int ovl_change_flags(struct file *file, unsigned int flags)
> {
> struct inode *inode = file_inode(file);
> int err;
>
> flags &= OVL_SETFL_MASK;
>
> if (((flags ^ file->f_flags) & O_APPEND) && IS_APPEND(inode))
> return -EPERM;
>
> if ((flags & O_DIRECT) && !(file->f_mode & FMODE_CAN_ODIRECT))
> return -EINVAL;
>
> if (file->f_op->check_flags) {
> err = file->f_op->check_flags(flags);
> if (err)
> return err;
> }
>
> spin_lock(&file->f_lock);
> file->f_flags = (file->f_flags & ~OVL_SETFL_MASK) | flags;
> spin_unlock(&file->f_lock);
>
> return 0;
> }
> open-coding what setfl() would've done, without updating ->f_iocb_flags...
> Not hard to deal with...
>
> I could pick it in vfs.git #fixes, or Miklos could put it through his tree.
> Miklos, which way would you prefer that to go?

I'll pick this into #overlayfs-next, as a PR for this cycle is needed anyway.

Thanks,
Miklos

\
 
 \ /
  Last update: 2022-11-24 21:35    [W:0.063 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site