int CVE_2010_1087_linux2_6_27_31_nfs_wait_on_request(struct nfs_page *req) { int ret = 0; if (!test_bit(PG_BUSY, &req->wb_flags)) goto out; ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY, nfs_wait_bit_killable, TASK_KILLABLE); out: return ret; }
/** * nfs_wait_on_request - Wait for a request to complete. * @req: request to wait upon. * * Interruptible by signals only if mounted with intr flag. * The user is responsible for holding a count on the request. */ int nfs_wait_on_request(struct nfs_page *req) { struct rpc_clnt *clnt = NFS_CLIENT(req->wb_context->dentry->d_inode); sigset_t oldmask; int ret = 0; if (!test_bit(PG_BUSY, &req->wb_flags)) goto out; /* * Note: the call to rpc_clnt_sigmask() suffices to ensure that we * are not interrupted if intr flag is not set */ rpc_clnt_sigmask(clnt, &oldmask); ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY, nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE); rpc_clnt_sigunmask(clnt, &oldmask); out: return ret; }