Skip to content

Commit 7041503

Browse files
committed
Merge tag 'misc-fixes-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull netfslib, cachefiles and afs fixes from David Howells: - Fix another couple of oopses in cachefiles tracing stemming from the possibility of passing in a NULL object pointer - Fix netfs_clear_unread() to set READ on the iov_iter so that source it is passed to doesn't do the wrong thing (some drivers look at the flag on iov_iter rather than other available information to determine the direction) - Fix afs_launder_page() to write back at the correct file position on the server so as not to corrupt data * tag 'misc-fixes-20211007' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix afs_launder_page() to set correct start file position netfs: Fix READ/WRITE confusion when calling iov_iter_xarray() cachefiles: Fix oops with cachefiles_cull() due to NULL object
2 parents 14df923 + 5c05224 commit 7041503

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

fs/afs/write.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,7 @@ int afs_launder_page(struct page *page)
974974
iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);
975975

976976
trace_afs_page_dirty(vnode, tracepoint_string("launder"), page);
977-
ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE,
978-
true);
977+
ret = afs_store_data(vnode, &iter, page_offset(page) + f, true);
979978
}
980979

981980
trace_afs_page_dirty(vnode, tracepoint_string("laundered"), page);

fs/netfs/read_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void netfs_clear_unread(struct netfs_read_subrequest *subreq)
150150
{
151151
struct iov_iter iter;
152152

153-
iov_iter_xarray(&iter, WRITE, &subreq->rreq->mapping->i_pages,
153+
iov_iter_xarray(&iter, READ, &subreq->rreq->mapping->i_pages,
154154
subreq->start + subreq->transferred,
155155
subreq->len - subreq->transferred);
156156
iov_iter_zero(iov_iter_count(&iter), &iter);

include/trace/events/cachefiles.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ TRACE_EVENT(cachefiles_unlink,
178178
),
179179

180180
TP_fast_assign(
181-
__entry->obj = obj->fscache.debug_id;
181+
__entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
182182
__entry->de = de;
183183
__entry->why = why;
184184
),
@@ -205,7 +205,7 @@ TRACE_EVENT(cachefiles_rename,
205205
),
206206

207207
TP_fast_assign(
208-
__entry->obj = obj->fscache.debug_id;
208+
__entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
209209
__entry->de = de;
210210
__entry->to = to;
211211
__entry->why = why;

0 commit comments

Comments
 (0)