mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	dax: remove the last BUG_ON() from fs/dax.c
Don't take down the kernel if we get an invalid 'from' and 'length' argument pair. Just warn once and return an error. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
		
							parent
							
								
									ce95ab0fa6
								
							
						
					
					
						commit
						aada54f980
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		
							
								
								
									
										3
									
								
								fs/dax.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								fs/dax.c
									
									
									
									
									
								
							| 
						 | 
					@ -1194,7 +1194,8 @@ int dax_zero_page_range(struct inode *inode, loff_t from, unsigned length,
 | 
				
			||||||
	/* Block boundary? Nothing to do */
 | 
						/* Block boundary? Nothing to do */
 | 
				
			||||||
	if (!length)
 | 
						if (!length)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	BUG_ON((offset + length) > PAGE_SIZE);
 | 
						if (WARN_ON_ONCE((offset + length) > PAGE_SIZE))
 | 
				
			||||||
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memset(&bh, 0, sizeof(bh));
 | 
						memset(&bh, 0, sizeof(bh));
 | 
				
			||||||
	bh.b_bdev = inode->i_sb->s_bdev;
 | 
						bh.b_bdev = inode->i_sb->s_bdev;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue