Commit fbf08efa authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'vfs-for-3.16' of git://git.infradead.org/users/hch/vfs

Pull vfs fixes from Christoph Hellwig:
 "A vfsmount leak fix, and a compile warning fix"

* 'vfs-for-3.16' of git://git.infradead.org/users/hch/vfs:
  fs: umount on symlink leaks mnt count
  direct-io: fix uninitialized warning in do_direct_IO()
parents 2bdb5eb7 295dc39d
...@@ -198,9 +198,8 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio) ...@@ -198,9 +198,8 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio)
* L1 cache. * L1 cache.
*/ */
static inline struct page *dio_get_page(struct dio *dio, static inline struct page *dio_get_page(struct dio *dio,
struct dio_submit *sdio, size_t *from, size_t *to) struct dio_submit *sdio)
{ {
int n;
if (dio_pages_present(sdio) == 0) { if (dio_pages_present(sdio) == 0) {
int ret; int ret;
...@@ -209,10 +208,7 @@ static inline struct page *dio_get_page(struct dio *dio, ...@@ -209,10 +208,7 @@ static inline struct page *dio_get_page(struct dio *dio,
return ERR_PTR(ret); return ERR_PTR(ret);
BUG_ON(dio_pages_present(sdio) == 0); BUG_ON(dio_pages_present(sdio) == 0);
} }
n = sdio->head++; return dio->pages[sdio->head];
*from = n ? 0 : sdio->from;
*to = (n == sdio->tail - 1) ? sdio->to : PAGE_SIZE;
return dio->pages[n];
} }
/** /**
...@@ -911,11 +907,15 @@ static int do_direct_IO(struct dio *dio, struct dio_submit *sdio, ...@@ -911,11 +907,15 @@ static int do_direct_IO(struct dio *dio, struct dio_submit *sdio,
while (sdio->block_in_file < sdio->final_block_in_request) { while (sdio->block_in_file < sdio->final_block_in_request) {
struct page *page; struct page *page;
size_t from, to; size_t from, to;
page = dio_get_page(dio, sdio, &from, &to);
page = dio_get_page(dio, sdio);
if (IS_ERR(page)) { if (IS_ERR(page)) {
ret = PTR_ERR(page); ret = PTR_ERR(page);
goto out; goto out;
} }
from = sdio->head ? 0 : sdio->from;
to = (sdio->head == sdio->tail - 1) ? sdio->to : PAGE_SIZE;
sdio->head++;
while (from < to) { while (from < to) {
unsigned this_chunk_bytes; /* # of bytes mapped */ unsigned this_chunk_bytes; /* # of bytes mapped */
......
...@@ -2256,9 +2256,10 @@ mountpoint_last(struct nameidata *nd, struct path *path) ...@@ -2256,9 +2256,10 @@ mountpoint_last(struct nameidata *nd, struct path *path)
goto out; goto out;
} }
path->dentry = dentry; path->dentry = dentry;
path->mnt = mntget(nd->path.mnt); path->mnt = nd->path.mnt;
if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW)) if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW))
return 1; return 1;
mntget(path->mnt);
follow_mount(path); follow_mount(path);
error = 0; error = 0;
out: out:
......
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