Re: [PATCH] cifs: when renaming don't try to unlink negative dentry
Steve French <[email protected]>
| Newsgroups | gmane.linux.file-systems.cifs |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Apr 17, 2009 at 6:02 PM, Jeff Layton <[email protected]> wrote: > On Fri, 17 Apr 2009 16:16:23 -0500 > Steve French <[email protected]> wrote: > >> I merged this, adding the CC: stable, but think we need to also >> consistently check for inode == NULL in cifs_unlink (we only check in >> two branches now) >> >> Any objections if I also add the following check: >> > > I think it would be preferable to just check once for inode==NULL in > cifs_unlink near the top and BUG() if it is. Note that vfs_unlink takes > the i_mutex on this before calling the .unlink inode op, so we're > guaranteed that the d_inode won't be NULL from that codepath. > > I think if we get an unlink on a negative dentry then we should > probably consider that a BUG(). > > Other .unlink ops also seem to assume that you can't call .unlink with > a negative dentry. I am more worried about internal calls to unlink from cifs slipping through with inode null. If we check in one branch we should check in the other, or as you suggest move it to the top -- Thanks, Steve