mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	isofs_cmp(): we'll never see a dentry for . or ..
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									d1b72cc6d8
								
							
						
					
					
						commit
						f643ff550a
					
				
					 1 changed files with 2 additions and 18 deletions
				
			
		| 
						 | 
					@ -18,23 +18,6 @@ static int
 | 
				
			||||||
isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
 | 
					isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct qstr qstr;
 | 
						struct qstr qstr;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!compare)
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* check special "." and ".." files */
 | 
					 | 
				
			||||||
	if (dlen == 1) {
 | 
					 | 
				
			||||||
		/* "." */
 | 
					 | 
				
			||||||
		if (compare[0] == 0) {
 | 
					 | 
				
			||||||
			if (!dentry->d_name.len)
 | 
					 | 
				
			||||||
				return 0;
 | 
					 | 
				
			||||||
			compare = ".";
 | 
					 | 
				
			||||||
		} else if (compare[0] == 1) {
 | 
					 | 
				
			||||||
			compare = "..";
 | 
					 | 
				
			||||||
			dlen = 2;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	qstr.name = compare;
 | 
						qstr.name = compare;
 | 
				
			||||||
	qstr.len = dlen;
 | 
						qstr.len = dlen;
 | 
				
			||||||
	return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
 | 
						return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
 | 
				
			||||||
| 
						 | 
					@ -146,6 +129,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
 | 
				
			||||||
				(!(de->flags[-sbi->s_high_sierra] & 1))) &&
 | 
									(!(de->flags[-sbi->s_high_sierra] & 1))) &&
 | 
				
			||||||
			(sbi->s_showassoc ||
 | 
								(sbi->s_showassoc ||
 | 
				
			||||||
				(!(de->flags[-sbi->s_high_sierra] & 4)))) {
 | 
									(!(de->flags[-sbi->s_high_sierra] & 4)))) {
 | 
				
			||||||
 | 
								if (dpnt && (dlen > 1 || dpnt[0] > 1))
 | 
				
			||||||
				match = (isofs_cmp(dentry, dpnt, dlen) == 0);
 | 
									match = (isofs_cmp(dentry, dpnt, dlen) == 0);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (match) {
 | 
							if (match) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue