Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151986738
D51573.id159263.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D51573.id159263.diff
View Options
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1268,7 +1268,8 @@
struct inode *fip, *tip, *tdp, *fdp;
struct direct newdir;
off_t endoff;
- int doingdirectory, newparent;
+ int doingdirectory;
+ u_int newparent;
int error = 0;
struct mount *mp;
ino_t ino;
@@ -1475,7 +1476,7 @@
* the user must have write permission in the source so
* as to be able to change "..".
*/
- if (doingdirectory && newparent) {
+ if (doingdirectory && newparent != 0) {
error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread);
if (error)
goto unlockout;
@@ -1538,7 +1539,7 @@
if (tip == NULL) {
if (ITODEV(tdp) != ITODEV(fip))
panic("ufs_rename: EXDEV");
- if (doingdirectory && newparent) {
+ if (doingdirectory && newparent != 0) {
/*
* Account for ".." in new directory.
* When source and destination have the same
@@ -1631,7 +1632,7 @@
goto bad;
}
if (doingdirectory) {
- if (!newparent) {
+ if (newparent == 0) {
tdp->i_effnlink--;
if (DOINGSOFTDEP(tdvp))
softdep_change_linkcnt(tdp);
@@ -1641,11 +1642,10 @@
softdep_change_linkcnt(tip);
}
error = ufs_dirrewrite(tdp, tip, fip->i_number,
- IFTODT(fip->i_mode),
- (doingdirectory && newparent) ? newparent : doingdirectory);
+ IFTODT(fip->i_mode), doingdirectory);
if (error) {
if (doingdirectory) {
- if (!newparent) {
+ if (newparent == 0) {
tdp->i_effnlink++;
if (DOINGSOFTDEP(tdvp))
softdep_change_linkcnt(tdp);
@@ -1668,7 +1668,7 @@
* disk, so when running with that code we avoid doing
* them now.
*/
- if (!newparent) {
+ if (newparent == 0) {
tdp->i_nlink--;
DIP_SET_NLINK(tdp, tdp->i_nlink);
UFS_INODE_SET_FLAG(tdp, IN_CHANGE);
@@ -1697,7 +1697,7 @@
* parent directory must be decremented
* and ".." set to point to the new parent.
*/
- if (doingdirectory && newparent) {
+ if (doingdirectory && newparent != 0) {
/*
* Set the directory depth based on its new parent.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 11:00 PM (6 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31378192
Default Alt Text
D51573.id159263.diff (2 KB)
Attached To
Mode
D51573: Another fix for UFS with inode number sign propagation
Attached
Detach File
Event Timeline
Log In to Comment