diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-10-12 16:28:11 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 11:02:54 +0100 |
commit | 31c3a7069593b072bd57192b63b62f9a7e994e9a (patch) | |
tree | 96c2cd32f5994a6ea284b79938c66d27e632023e | |
parent | ovl: update doc (diff) | |
download | linux-31c3a7069593b072bd57192b63b62f9a7e994e9a.tar.xz linux-31c3a7069593b072bd57192b63b62f9a7e994e9a.zip |
Revert "ovl: get_write_access() in truncate"
This reverts commit 03bea60409328de54e4ff7ec41672e12a9cb0908.
Commit 4d0c5ba2ff79 ("vfs: do get_write_access() on upper layer of
overlayfs") makes the writecount checks inside overlayfs superfluous, the
file is already copied up and write access acquired on the upper inode when
ovl_setattr is called with ATTR_SIZE.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r-- | fs/overlayfs/inode.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 7fb53d055537..a572e38349f6 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -64,27 +64,10 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr) if (err) goto out; - if (attr->ia_valid & ATTR_SIZE) { - struct inode *realinode = d_inode(ovl_dentry_real(dentry)); - - err = -ETXTBSY; - if (atomic_read(&realinode->i_writecount) < 0) - goto out_drop_write; - } - err = ovl_copy_up(dentry); if (!err) { - struct inode *winode = NULL; - upperdentry = ovl_dentry_upper(dentry); - if (attr->ia_valid & ATTR_SIZE) { - winode = d_inode(upperdentry); - err = get_write_access(winode); - if (err) - goto out_drop_write; - } - if (attr->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) attr->ia_valid &= ~ATTR_MODE; @@ -95,11 +78,7 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr) if (!err) ovl_copyattr(upperdentry->d_inode, dentry->d_inode); inode_unlock(upperdentry->d_inode); - - if (winode) - put_write_access(winode); } -out_drop_write: ovl_drop_write(dentry); out: return err; |