lkml.org 
[lkml]   [2008]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 10/24] vfs: truncate: append-only checking cleanup
From
Date
> > -	error = -EPERM;
> > - if (IS_APPEND(inode))
> > - goto mnt_drop_write_and_out;
> > -
> > error = get_write_access(inode);
> > if (error)
> > goto mnt_drop_write_and_out;
>
> errno change and worse than that - we
> a) get different errno with append-only file mmaped shared
> b) break_lease() happening, despite the file being append-only
>
> > @@ -321,10 +317,6 @@ static long do_sys_ftruncate(unsigned in
> > if (small && length > MAX_NON_LFS)
> > goto out_putf;
> >
> > - error = -EPERM;
> > - if (IS_APPEND(inode))
> > - goto out_putf;
> > -
> > error = locks_verify_truncate(inode, file, length);
>
> Again, errno change...
>
> > @@ -1639,8 +1639,6 @@ int may_open(struct nameidata *nd, int a
> > if (IS_APPEND(inode)) {
> > if ((flag & FMODE_WRITE) && !(flag & O_APPEND))
> > return -EPERM;
> > - if (flag & O_TRUNC)
> > - return -EPERM;
> > }
>
> Bogus break_lease() following that...
>

OK, I'll drop this patch. Truncate is weird, it should really have a
separate i_op/f_op.

Miklos


\
 
 \ /
  Last update: 2008-05-15 10:01    [W:0.021 / U:3.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site