Skip to content

Commit 9641d9b

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS
If the commit to disk is interrupted, we should still first check for filesystem errors so that we can report them in preference to the error due to the signal. Fixes: 2197e9b ("NFS: Fix up fsync() when the server rebooted") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent cea9ba7 commit 9641d9b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

fs/nfs/file.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,16 @@ static int
204204
nfs_file_fsync_commit(struct file *file, int datasync)
205205
{
206206
struct inode *inode = file_inode(file);
207-
int ret;
207+
int ret, ret2;
208208

209209
dprintk("NFS: fsync file(%pD2) datasync %d\n", file, datasync);
210210

211211
nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
212212
ret = nfs_commit_inode(inode, FLUSH_SYNC);
213-
if (ret < 0)
214-
return ret;
215-
return file_check_and_advance_wb_err(file);
213+
ret2 = file_check_and_advance_wb_err(file);
214+
if (ret2 < 0)
215+
return ret2;
216+
return ret;
216217
}
217218

218219
int

0 commit comments

Comments
 (0)