CIFS: Protect i_nlink from being negative
that can cause warning messages. Pavel had initially suggested a smaller patch around drop_nlink, after a similar problem was discovered NFS. Protecting additional places where nlink is touched was suggested by Jeff Layton and is included in this. Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
@@ -433,7 +433,9 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
|
||||
if (old_file->d_inode) {
|
||||
cifsInode = CIFS_I(old_file->d_inode);
|
||||
if (rc == 0) {
|
||||
spin_lock(&old_file->d_inode->i_lock);
|
||||
inc_nlink(old_file->d_inode);
|
||||
spin_unlock(&old_file->d_inode->i_lock);
|
||||
/* BB should we make this contingent on superblock flag NOATIME? */
|
||||
/* old_file->d_inode->i_ctime = CURRENT_TIME;*/
|
||||
/* parent dir timestamps will update from srv
|
||||
|
Reference in New Issue
Block a user