Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix up CIFS for "test_clear_page_dirty()" removal

This also adds he required page "writeback" flag handling, that cifs
hasn't been doing and that the page dirty flag changes made obvious.

Acked-by: Steve French <smfltc@us.ibm.com>
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

+23 -3
+23 -3
fs/cifs/file.c
··· 1245 1245 wait_on_page_writeback(page); 1246 1246 1247 1247 if (PageWriteback(page) || 1248 - !test_clear_page_dirty(page)) { 1248 + !clear_page_dirty_for_io(page)) { 1249 1249 unlock_page(page); 1250 1250 break; 1251 1251 } 1252 1252 1253 + /* 1254 + * This actually clears the dirty bit in the radix tree. 1255 + * See cifs_writepage() for more commentary. 1256 + */ 1257 + set_page_writeback(page); 1258 + 1253 1259 if (page_offset(page) >= mapping->host->i_size) { 1254 1260 done = 1; 1255 1261 unlock_page(page); 1262 + end_page_writeback(page); 1256 1263 break; 1257 1264 } 1258 1265 ··· 1323 1316 SetPageError(page); 1324 1317 kunmap(page); 1325 1318 unlock_page(page); 1319 + end_page_writeback(page); 1326 1320 page_cache_release(page); 1327 1321 } 1328 1322 if ((wbc->nr_to_write -= n_iov) <= 0) ··· 1360 1352 if (!PageUptodate(page)) { 1361 1353 cFYI(1, ("ppw - page not up to date")); 1362 1354 } 1363 - 1355 + 1356 + /* 1357 + * Set the "writeback" flag, and clear "dirty" in the radix tree. 1358 + * 1359 + * A writepage() implementation always needs to do either this, 1360 + * or re-dirty the page with "redirty_page_for_writepage()" in 1361 + * the case of a failure. 1362 + * 1363 + * Just unlocking the page will cause the radix tree tag-bits 1364 + * to fail to update with the state of the page correctly. 1365 + */ 1366 + set_page_writeback(page); 1364 1367 rc = cifs_partialpagewrite(page, 0, PAGE_CACHE_SIZE); 1365 1368 SetPageUptodate(page); /* BB add check for error and Clearuptodate? */ 1366 1369 unlock_page(page); 1367 - page_cache_release(page); 1370 + end_page_writeback(page); 1371 + page_cache_release(page); 1368 1372 FreeXid(xid); 1369 1373 return rc; 1370 1374 }