goto dput_and_out;
if (!check_mnt(mnt))
goto dput_and_out;
+ retval = -EPERM;
+ if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN))
+ goto dput_and_out;
retval = do_umount(mnt, flags);
+#ifdef UMOUNT_LOG
+ {
+ printk("Ahsin do_umount retval=%d \n",retval);
+ //do_umount success: 0, do_umount busy: -16
+ //if do_umount fail, need to dump the link list here
+
+ if(retval)
+ printk("Ahsin do_umount fail; mnt_get_count=%d mnt->mnt_devname=%s\n",mnt_get_count(mnt),mnt->mnt_devname);
+ else
+ printk("Ahsin do_umount success; mnt_get_count=%d mnt->mnt_devname=%s\n",mnt_get_count(mnt),mnt->mnt_devname);
+
+ // print linked list
+ spin_lock(&mnt_id_lock);
+ ref_current = ref_head;
+ while(ref_current != NULL)
+ {
+ total_value = total_value + ref_current->count;
+
+ if (ref_current->count)
+ printk("Ahsin PID= %d, Name = %s, Count= %d \n", ref_current->pid, ref_current->name, ref_current->count);
+ ref_current = ref_current->next;
+ }
+ spin_unlock(&mnt_id_lock);
+ printk("Ahsin total_value=%d \n",total_value);
+ }
+#endif
dput_and_out:
/* we mustn't call path_put() as that would clear mnt_expiry_mark */
dput(path.dentry);