The patch titled CacheFiles: Handle ENOSPC on create/mkdir better has been removed from the -mm tree. Its filename was fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better.patch This patch was dropped because it is obsolete ------------------------------------------------------ Subject: CacheFiles: Handle ENOSPC on create/mkdir better From: David Howells <dhowells@xxxxxxxxxx> Handle ENOSPC on create/mkdir calls to the backing filesystem better. Rather than returning it to FS-Cache or FS-Cache returning it to the netfs, it is converted into ENOBUFS. This can be reproduced by setting up a very small cache, for example with: dd if=/dev/zero of=/root/fakedisc bs=10240 count=1024 mke2fs -j /root/fakedisc tune2fs -o user_xattr /root/fakedisc mount -o loop /root/fakedisc /var/fscache/ cachefilesd And then running a "find" over a few thousand NFS files on an NFS share that's mounted with "-o fsc". This will eventually run the cache out of free inodes, and ENOSPC will be returned by Ext3, yielding a lot of these messages in the kernel log: FS-Cache: error from cache: -28 Signed-off-by: David Howells <dhowells@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/cachefiles/cf-namei.c | 7 ++++++- fs/fscache/cookie.c | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff -puN fs/cachefiles/cf-namei.c~fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better fs/cachefiles/cf-namei.c --- a/fs/cachefiles/cf-namei.c~fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better +++ a/fs/cachefiles/cf-namei.c @@ -501,11 +501,13 @@ lookup_again: return 0; create_error: + _debug("create error %d", ret); if (ret == -EIO) cachefiles_io_error(cache, "create/mkdir failed"); goto error; check_error: + _debug("check error %d", ret); write_lock(&cache->active_lock); rb_erase(&object->active_node, &cache->active_nodes); write_unlock(&cache->active_lock); @@ -538,7 +540,10 @@ error_out: current->fsuid = fsuid; current->fsgid = fsgid; - _leave(" = ret"); + if (ret == -ENOSPC) + ret = -ENOBUFS; + + _leave(" = error %d", -ret); return ret; } diff -puN fs/fscache/cookie.c~fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better fs/fscache/cookie.c --- a/fs/fscache/cookie.c~fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better +++ a/fs/fscache/cookie.c @@ -750,7 +750,10 @@ no_cache: ret = -ENOMEDIUM; goto error_cleanup; error: - printk(KERN_ERR "FS-Cache: error from cache: %d\n", ret); + if (ret != -ENOBUFS) { + printk(KERN_ERR "FS-Cache: error from cache: %d\n", ret); + ret = -ENOBUFS; + } error_cleanup: if (cookie) { up_write(&cookie->sem); _ Patches currently in -mm which might be from dhowells@xxxxxxxxxx are origin.patch nfs-represent-64-bit-fileids-as-64-bit-inode-numbers-on-32-bit-systems.patch security-keys-user-kmemdup.patch log2-implement-a-general-integer-log2-facility-in-the-kernel.patch log2-implement-a-general-integer-log2-facility-in-the-kernel-fix.patch log2-implement-a-general-integer-log2-facility-in-the-kernel-vs-git-cryptodev.patch log2-implement-a-general-integer-log2-facility-in-the-kernel-ppc-fix.patch log2-alter-roundup_pow_of_two-so-that-it-can-use-a-ilog2-on-a-constant.patch log2-alter-get_order-so-that-it-can-make-use-of-ilog2-on-a-constant.patch log2-provide-ilog2-fallbacks-for-powerpc.patch fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-cachefiles-handle-enospc-on-create-mkdir-better.patch fs-cache-cachefiles-a-cache-that-backs-onto-a-mounted-filesystem-inode-count-maintenance.patch afs-amend-the-afs-configuration-options.patch reiser4-get_sb_dev-fix.patch mutex-subsystem-synchro-test-module.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html