Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

337 lines
13 KiB

  1. This is a list of code "concerns". these have been removed from the code and
  2. placed here so that the code will not contain untoward comments.
  3. rx\read.c and write.c
  4. tomm claims that the memory manager has been fixed before nt4.0 shipped
  5. so that it is no longer necessary to synchronize flushers by acquiring and
  6. releasing the pagingio resource. the is in the check for noncachedio when there
  7. is a private cachemap. we should make sure that everyone else removes their
  8. synchronization or we should put ours back.
  9. rx\read.c and write.c
  10. the pipe read/write paths should be completely separated in the wrapper
  11. and the opportunity to do so should be presented in the mini.
  12. rx\read.c
  13. there is a place where we set status pipe empty; at that point we should
  14. also backoff a la rdr1
  15. rx\lock.c
  16. there should be backoff logic
  17. rx\strtstop.c
  18. the call to rxforcenettablefinalization should be per-minirdr and should
  19. be moved out of the iftest.
  20. rx\strtstop
  21. acquireing the netname table lock is was only required becauseof
  22. precious servers. now that that's gone. we should remove the lock. but, it's
  23. safe, of course.
  24. mrx in general
  25. we should review the throttling constants....seem pretty conservative to
  26. me; we should consider being substantially more aggressive.
  27. mrx
  28. we should have precious server code.
  29. rx\lockctrl.c
  30. we should only allocate a lock structure if someone does a lock! same
  31. with the oplock structure. ntfs does this. obviously, we would have a change in
  32. fcb.h to go with this.
  33. rx\lockctrl.c
  34. the last little bit of getting the refcounts right was to account for
  35. the fact that the fspdispatch does not remove a reference if pending is
  36. returned. this is probably wrong....and we should map over to a scheme where the
  37. fsd and fsp dispatches are the ones that do this instead of having every common
  38. routine do it. this would be a major change but it would really make things more
  39. consistent.
  40. rx\lockctrl.c
  41. it is stupid that we will have to lookup the lock again if it fails
  42. (async completion path). we should ask for an fsrtl interface that removes a
  43. lock that i provide.
  44. rx\create.c
  45. in RxCreateFromNetRoot, after the call to
  46. rx\ntinit.c
  47. in RxGetRegistryParameters, we should allocate space for Storage
  48. instead. really what we should do is to implement and export a routine that both
  49. allocates and reads a string........for Ulong no allocation should be necessary
  50. rx\ntfsp.c
  51. in fspdispatch and also addtoworkq, we use the wrapper's device object
  52. for throttling instead of the minirdr's device object. this will change.
  53. rx\ntfsp.c
  54. in fspdispatch, if status_retry is returned then we will have already
  55. completed the packet.
  56. rx\ntfsp.c
  57. prepostirp should be made pageable; also, i'm not too happy
  58. rx\ntfsd.c
  59. initialization of prefixtable should be in RxInitializeDispatchVectors
  60. rx\ntfsd.c
  61. RxFsdCommonDispatch in an excellent canididate for inlining
  62. rx\ntfsd.c
  63. we shouldn't be checking everywhere for null dispatch points....rather
  64. we should fill them in with a good default
  65. rx\ntfsd.c
  66. we should remove the async code from everywhere else and have it only in
  67. fsddispatch and fspdispatch. same with retry. this would get rid of the
  68. "should i remove a reference or not" decision.
  69. rx\??
  70. the code that chains together pagingio reads should be removed
  71. rx\ntfastio.c
  72. in fastiocheckifpossible...return the error directly. also, we should
  73. the cached netroottype as well as nodetype to determine if it's a
  74. diskfile. also in markoncleanup.
  75. rx\ntexcept.c
  76. i removed this from the header
  77. Original Comments
  78. This routine process an exception. It either completes the request
  79. with the saved exception status or it sends it off to IoRaiseHardError()
  80. My New Improved Version
  81. This routine processes an exception from the top level FSD routine. You can tell because it has
  82. an Irp w/o an RxContext. The original code did all kinds of stuff like raising hard errors and
  83. posting and such. My take is different...if you get here, things are hosed. So we either complete
  84. or we bugcheck. PERIOD. we can always be more liberal later...........
  85. rx\ntfsd.c
  86. in RxDevFcbQueryDeviceInfo, the special handling for pipes should be
  87. removed.
  88. rx\lockctrl.c
  89. don't allocate a lock structure unless you need one. also in fcb.h and
  90. fcbstruc.c
  91. rx\lockctrl.c
  92. at rxunlock, we could be called from the cleanup routine on the last
  93. handle. in such a case, we should just swallow the unlocks. this might be a
  94. minirdr thing instead.
  95. rx\fsctrl.c
  96. in RxLowIoFsCtlShell, we should have to switch out again. we should have
  97. handled the peeknamepipe throttling directly in the entry routine.
  98. rx\flush.c
  99. maybe we should try to route for filetypes that we don't understand. or
  100. at least to have the minirdr signal that we should doit thru some stateful call.
  101. rx\fileinfo.c
  102. i remove the following
  103. //CODE.IMPROVEMENT having a separate wrapper for every routine is stupid. we should (a) only
  104. // have it if we need it and (b) preinitialize the buffer and lengthremaining so we don't always
  105. // have to pass them.
  106. [considering this we should fix the trace as well........]
  107. and
  108. //CODE.IMPROVEMENT probably there's a better way than this to figure out whether
  109. // we need the resource at all or need it shared or need it excl.
  110. // for name, we don't need it at all since the name never changes
  111. and from allinfo handling
  112. //CODE.IMPROVEMENT.ASHAMED either here or in the minirdr we should glob up call so that multiple trips
  113. // are not taken
  114. rx\fileinfo.c
  115. you shouldn't do the fsrtloplock check for pipes. this keeps us from not
  116. allocating the struct
  117. rx\fileinfo.c
  118. should we really change the name in the fcb after a rename. it
  119. complicates locking a bit for querys
  120. rx\dirctrl.c
  121. no need to allocate templace buffer if it's small enough. most templates
  122. are probably less than 8.3 in size
  123. rx\create.c
  124. the writeserialization field in the fobx is used by spoolfiles as well
  125. as pipes. maybe a name change to the specific field could reflect this dual
  126. usage.
  127. rx\create.c
  128. perhaps we should wait to finalize on a failed open.
  129. rx\create.c
  130. it would be good to "summarize" the fcb names that are logged
  131. rx\create.c
  132. we should have a flag on fcb/netroot somewhere to denote that only
  133. 32-bit operations are possible instead of having every mini have to check.
  134. rxce\scavengr.c
  135. in scavenge-fobxs, starting at the beginning of the list each time is
  136. bad. what if there is some problem then we'd never get off the first guy.
  137. rxce\prefix.c
  138. i removed this comment from the lookup
  139. // CODE.IMPROVEMENT we need code to lookup vnetroots MUCH faster....like a 26way cache........
  140. // failing that, we could at least not do the lookups (and hash computation)
  141. // until we're on the third component, i.e. \;m:\server\share. the cache is better.
  142. rxce\fcbstruc.c
  143. in finishfcbinitialization, we should not initialize the lock structure
  144. for pipes. of course, we shouldn't even have a lock structure yet but that's a
  145. different c.i.
  146. rxce\buffring.c
  147. i removed the following comment from RxChangeBufferingState
  148. //CODE.IMPROVEMENT we sure use up a lot of log entries in here! maybe we should put this state info
  149. // on the fcb.
  150. BUGBUG
  151. rxce\rxcontx.c
  152. the priority boost is set to disk....probably should be net. actually
  153. should be mini parameter.
  154. in the place where we check for advance-only on setfileinfo, we'd need a
  155. bit different for locals. there are a couple of places.
  156. rxce\rxconnct.c
  157. i removed the following from RxConstructSrvCall
  158. //BUGBUG we should have some sort of refcount machanism to prevent a minirdr from
  159. // unregistering while he's part of a calldown
  160. //also, we shouldn't necessarily be calling down if this guy is not a UNC provider
  161. rxce\fcbstruc.c
  162. in RxWaitForStableCondition, you need to be able to cancel.
  163. rxce\fcbstruc.c
  164. in RxCreateNetRoot,
  165. //TRUE means case insensitive compares BUGBUG get this from srvcall
  166. turns out, the whole issue of casing is incorrectly handled because
  167. there is no way to get casing handled on a per-call basis in case the
  168. casesensitive flag is set on open.
  169. rxce\fcbstruc.c
  170. in RxCreateNetFcb,
  171. //BUGBUG: this should be on the fobx......not on the FCB. it should then be used correctly
  172. // in the querynameinfo code. same with stripped backslash
  173. the flag in question is RX_CONTEXT_CREATE_FLAG_ADDEDBACKSLASH.
  174. rx\strtstop.c
  175. in RxStopMinirdr, the comment was removed from the following line
  176. RxTerminateScavenging(RxContext); //BUGBUG separate into the two parts and make the purge depend on the DObj
  177. rx\lockctrl.c
  178. in RxUnlockOperation, the following comment was removed where we try to
  179. allocate
  180. //bugbug we cannot fail........i guess what we'd have to do is to send the unlock
  181. //from here!
  182. rx\fileinfo.c
  183. in RxQueryStandardInfo, i removed this about the fact that links are
  184. returned incorrectly
  185. //BUGBUG there is a problem here with number of links...basically, the deal is that numberoflinks is
  186. //dynamic whereas everything else in the structure is knowable by the client side under oplock.
  187. rx\create.c
  188. in , i removed this about downlevel canonicalization.
  189. DOWNLEVEL.BUGBUG we don't really do it yet but we do
  190. componentize and check for .. and .; for names that come down from win32
  191. this is fine.....for direct names going to downlevel servers we should do
  192. more checking maybe.
  193. rx\create.c
  194. in RxCanonicalizeFileNameByServerSpecs, i removed the comment on this
  195. line both places
  196. && RX2C_IS_DOT(Buffer[firstchar+2])) //??BUGBUG what about a alternate stream :.
  197. rx\read.c
  198. need to implement a policy for controlling readahead differently for
  199. different customers
  200. rx\dirctrl.c
  201. i removed this at the place when the uniarg template is comared
  202. // then match all names. joejoe....do i really need all this?? ntfs doesn't!
  203. rx\create.c
  204. this from the header comments in RxCreateFromNetRoot:
  205. joejoe There is some possibility that we should just keep shared on the tablelock until we
  206. dispatch to the minirdr. That would save one release/acquire per open.
  207. rx\cleanup.c
  208. removed the joejoe from this
  209. if (NeedDelete || NeedPurge) {
  210. //joejoe need to put in logic to keep a new read/write from
  211. //reinitializing
  212. RxDbgTrace(0, Dbg, ("CleanupPurge:MmFlushImage\n", 0));
  213. MmFlushImageSection(&capFcb->NonPaged->SectionObjectPointers,
  214. MmFlushForWrite);
  215. rx\cleanup.c
  216. and from this.....
  217. KeQuerySystemTime( &CurrentTime );
  218. //
  219. // Note that we HAVE to use BooleanFlagOn() here because
  220. // FO_FILE_SIZE_CHANGED > 0x80 (i.e., not in the first byte).
  221. //
  222. //joejoe we need to probably do changetime independently
  223. //perhaps the smartest thing would just to put a basicinfo
  224. //struc in the fcb
  225. rxce\rxconnct.c
  226. from RxConstructSrvCall, removed the joejoe
  227. //joejoe we should have a structure tag on this
  228. pSrvCalldownStructure = RxAllocatePoolWithTag(
  229. NonPagedPool,
  230. sizeof(MRX_SRVCALLDOWN_STRUCTURE) +
  231. (sizeof(MRX_SRVCALL_CALLBACK_CONTEXT) * NumberOfMinirdrs),
  232. 'CSxR' );
  233. if (pSrvCalldownStructure == NULL) {
  234. ExReleaseFastMutexUnsafe(&RxData.MinirdrRegistrationMutex);
  235. return STATUS_INSUFFICIENT_RESOURCES;
  236. }
  237. rxce\fcbstruc.c
  238. from RxFinalizeSrvOpen, removed the joejoe remark
  239. if (ThisSrvOpen->Condition == Condition_Good) {
  240. RxPurgeChangeBufferingStateRequestsForSrvOpen(ThisSrvOpen);
  241. }
  242. //joejoe we could put sme more asserts in here about empty srvfobxlist etc.
  243. // close the file.
  244. MINIRDR_CALL_THROUGH(Status,Fcb->MRxDispatch,MRxForceClosed,((PMRX_SRV_OPEN)ThisSrvOpen));
  245. }
  246. rxce\buffring.c
  247. from RxChangeBufferingState, removed joejoe
  248. MINIRDR_CALL_THROUGH(
  249. Status,
  250. Fcb->MRxDispatch,
  251. MRxCompleteBufferingStateChangeRequest,
  252. (RxContext,(PMRX_SRV_OPEN)SrvOpen,Context));
  253. }
  254. //joejoe this could fail!!!! we should place the fcb into a
  255. // "failed oplock break" state.
  256. RxDereferenceAndDeleteRxContext(RxContext);
  257. }
  258. AND
  259. } finally {
  260. ClearFlag(Fcb->FcbState,FCB_STATE_BUFFERSTATE_CHANGING); //this is informational for error recovery
  261. //joejoe there should be a callout here for a readpolicy...not vanilla..........
  262. }
  263.