mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	nfsd: assume writeable exportabled filesystems have f_sync
I don't really see how you could claim to support nfsd and not support fsync somehow. And in practice a quick look through the exportable filesystems suggests the only ones without an ->fsync are read-only (efs, isofs, squashfs) or in-memory (shmem). Also, performing a write and then returning an error if the sync fails (as we would do here in the wgather case) seems unhelpful to clients. Also remove an incorrect comment. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
		
							parent
							
								
									7fa10cd12d
								
							
						
					
					
						commit
						fae5096ad2
					
				
					 1 changed files with 0 additions and 13 deletions
				
			
		| 
						 | 
					@ -1020,21 +1020,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 | 
				
			||||||
	inode = dentry->d_inode;
 | 
						inode = dentry->d_inode;
 | 
				
			||||||
	exp   = fhp->fh_export;
 | 
						exp   = fhp->fh_export;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
					 | 
				
			||||||
	 * Request sync writes if
 | 
					 | 
				
			||||||
	 *  -	the sync export option has been set, or
 | 
					 | 
				
			||||||
	 *  -	the client requested O_SYNC behavior (NFSv3 feature).
 | 
					 | 
				
			||||||
	 *  -   The file system doesn't support fsync().
 | 
					 | 
				
			||||||
	 * When NFSv2 gathered writes have been configured for this volume,
 | 
					 | 
				
			||||||
	 * flushing the data to disk is handled separately below.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp);
 | 
						use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!file->f_op->fsync) {/* COMMIT3 cannot work */
 | 
					 | 
				
			||||||
	       stable = 2;
 | 
					 | 
				
			||||||
	       *stablep = 2; /* FILE_SYNC */
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!EX_ISSYNC(exp))
 | 
						if (!EX_ISSYNC(exp))
 | 
				
			||||||
		stable = 0;
 | 
							stable = 0;
 | 
				
			||||||
	if (stable && !use_wgather) {
 | 
						if (stable && !use_wgather) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue