Created attachment 456028 [details] Program to test Description of problem: If you try to do a Direct IO write operation you get ENOMEM. I've seen this happen on `2.6.18-194.24.1.el5` but not on `2.6.18-194.17.1.el5` I've attached a small c program to test this. Just run $ nfsdio /path/to/mounted/nfs It should work. And it always works on local file systems so they could be used to test for validity of the code. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Looks like the bug is this condition in nfs_direct_write: dreq->l_ctx = nfs_get_lock_context(dreq->ctx); if (dreq->l_ctx != NULL) goto out_release; ...that should be a "== NULL". It's also broken upstream, so this needs to be fixed there too (and probably cc stable).
--- ./fs/nfs/direct.c.save 2010-09-22 08:38:17.000000000 -0400 +++ ./fs/nfs/direct.c 2010-10-27 15:11:48.000000000 -0400 @@ -726,7 +726,7 @@ static ssize_t nfs_direct_write(struct k dreq->inode = inode; dreq->ctx = get_nfs_open_context((struct nfs_open_context *)iocb->ki_filp->private_data); dreq->l_ctx = nfs_get_lock_context(dreq->ctx); - if (dreq->l_ctx != NULL) + if (dreq->l_ctx == NULL) goto out_release; if (!is_sync_kiocb(iocb)) dreq->iocb = iocb; Does indeed fix the problem...