X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=fs%2Fceph%2Ffile.c;h=18630e80020809f18a6a534b2a88249bfa81bd80;hb=90e01058bc36b03c638a073cda13bc8e12f3d0f4;hp=0f5375d8e030591eed3a7b71b3fe712f53e729d1;hpb=f44dd184634d401f5cf88a6d8b4a60d5ff4f417f;p=cascardo%2Flinux.git diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 0f5375d8e030..18630e800208 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -886,7 +886,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, int num_pages = 0; int flags; int ret; - struct timespec mtime = current_fs_time(inode->i_sb); + struct timespec mtime = current_time(inode); size_t count = iov_iter_count(iter); loff_t pos = iocb->ki_pos; bool write = iov_iter_rw(iter) == WRITE; @@ -902,10 +902,10 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, return ret; if (write) { - ret = invalidate_inode_pages2_range(inode->i_mapping, + int ret2 = invalidate_inode_pages2_range(inode->i_mapping, pos >> PAGE_SHIFT, (pos + count) >> PAGE_SHIFT); - if (ret < 0) + if (ret2 < 0) dout("invalidate_inode_pages2_range returned %d\n", ret); flags = CEPH_OSD_FLAG_ORDERSNAP | @@ -1091,7 +1091,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, int flags; int check_caps = 0; int ret; - struct timespec mtime = current_fs_time(inode->i_sb); + struct timespec mtime = current_time(inode); size_t count = iov_iter_count(from); if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) @@ -1272,7 +1272,8 @@ again: statret = __ceph_do_getattr(inode, page, CEPH_STAT_CAP_INLINE_DATA, !!page); if (statret < 0) { - __free_page(page); + if (page) + __free_page(page); if (statret == -ENODATA) { BUG_ON(retry_op != READ_INLINE); goto again;