Commit afe03f08 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ovl-fixes-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs

Pull overlayfs fixes from Amir Goldstein:
 "Two fixes for pretty old regressions"

* tag 'ovl-fixes-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
  ovl: fix incorrect fdput() on aio completion
  ovl: fix failed copyup of fileattr on a symlink
parents 0bb80ecc 724768a3
...@@ -618,7 +618,8 @@ static int ovl_copy_up_metadata(struct ovl_copy_up_ctx *c, struct dentry *temp) ...@@ -618,7 +618,8 @@ static int ovl_copy_up_metadata(struct ovl_copy_up_ctx *c, struct dentry *temp)
if (err) if (err)
return err; return err;
if (inode->i_flags & OVL_COPY_I_FLAGS_MASK) { if (inode->i_flags & OVL_COPY_I_FLAGS_MASK &&
(S_ISREG(c->stat.mode) || S_ISDIR(c->stat.mode))) {
/* /*
* Copy the fileattr inode flags that are the source of already * Copy the fileattr inode flags that are the source of already
* copied i_flags * copied i_flags
......
...@@ -19,7 +19,6 @@ struct ovl_aio_req { ...@@ -19,7 +19,6 @@ struct ovl_aio_req {
struct kiocb iocb; struct kiocb iocb;
refcount_t ref; refcount_t ref;
struct kiocb *orig_iocb; struct kiocb *orig_iocb;
struct fd fd;
}; };
static struct kmem_cache *ovl_aio_request_cachep; static struct kmem_cache *ovl_aio_request_cachep;
...@@ -280,7 +279,7 @@ static rwf_t ovl_iocb_to_rwf(int ifl) ...@@ -280,7 +279,7 @@ static rwf_t ovl_iocb_to_rwf(int ifl)
static inline void ovl_aio_put(struct ovl_aio_req *aio_req) static inline void ovl_aio_put(struct ovl_aio_req *aio_req)
{ {
if (refcount_dec_and_test(&aio_req->ref)) { if (refcount_dec_and_test(&aio_req->ref)) {
fdput(aio_req->fd); fput(aio_req->iocb.ki_filp);
kmem_cache_free(ovl_aio_request_cachep, aio_req); kmem_cache_free(ovl_aio_request_cachep, aio_req);
} }
} }
...@@ -342,10 +341,9 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter) ...@@ -342,10 +341,9 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter)
if (!aio_req) if (!aio_req)
goto out; goto out;
aio_req->fd = real;
real.flags = 0; real.flags = 0;
aio_req->orig_iocb = iocb; aio_req->orig_iocb = iocb;
kiocb_clone(&aio_req->iocb, iocb, real.file); kiocb_clone(&aio_req->iocb, iocb, get_file(real.file));
aio_req->iocb.ki_complete = ovl_aio_rw_complete; aio_req->iocb.ki_complete = ovl_aio_rw_complete;
refcount_set(&aio_req->ref, 2); refcount_set(&aio_req->ref, 2);
ret = vfs_iocb_iter_read(real.file, &aio_req->iocb, iter); ret = vfs_iocb_iter_read(real.file, &aio_req->iocb, iter);
...@@ -409,10 +407,9 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) ...@@ -409,10 +407,9 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
if (!aio_req) if (!aio_req)
goto out; goto out;
aio_req->fd = real;
real.flags = 0; real.flags = 0;
aio_req->orig_iocb = iocb; aio_req->orig_iocb = iocb;
kiocb_clone(&aio_req->iocb, iocb, real.file); kiocb_clone(&aio_req->iocb, iocb, get_file(real.file));
aio_req->iocb.ki_flags = ifl; aio_req->iocb.ki_flags = ifl;
aio_req->iocb.ki_complete = ovl_aio_rw_complete; aio_req->iocb.ki_complete = ovl_aio_rw_complete;
refcount_set(&aio_req->ref, 2); refcount_set(&aio_req->ref, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment