Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157370 Details for
Bug 244848
SIlent truncation of files when NFS quota reached
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Check errors returned by fsync call
samba-3.0.25c-checkerr-onsync.patch (text/plain), 6.14 KB, created by
David Losada
on 2007-06-19 14:08:58 UTC
(
hide
)
Description:
Check errors returned by fsync call
Filename:
MIME Type:
Creator:
David Losada
Created:
2007-06-19 14:08:58 UTC
Size:
6.14 KB
patch
obsolete
>Index: smbd/reply.c >=================================================================== >--- smbd/reply.c (revision 23507) >+++ smbd/reply.c (working copy) >@@ -2743,6 +2743,7 @@ > BOOL write_through; > files_struct *fsp = file_fsp(inbuf,smb_vwv0); > int outsize = 0; >+ NTSTATUS status; > START_PROFILE(SMBwritebraw); > > if (srv_is_signing_active()) { >@@ -2847,7 +2848,13 @@ > > SSVAL(outbuf,smb_vwv0,total_written); > >- sync_file(conn, fsp, write_through); >+ status = sync_file(conn, fsp, write_through); >+ if (!NT_STATUS_IS_OK(status)) { >+ DEBUG(5,("reply_writebraw: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ END_PROFILE(SMBwritebraw); >+ return ERROR_NT(status); >+ } > > DEBUG(3,("writebraw2 fnum=%d start=%.0f num=%d wrote=%d\n", > fsp->fnum, (double)startpos, (int)numtowrite,(int)total_written)); >@@ -2912,7 +2919,13 @@ > nwritten = write_file(fsp,data,startpos,numtowrite); > } > >- sync_file(conn, fsp, False /* write through */); >+ status = sync_file(conn, fsp, False /* write through */); >+ if (!NT_STATUS_IS_OK(status)) { >+ END_PROFILE(SMBwriteunlock); >+ DEBUG(5,("reply_writeunlock: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ return ERROR_NT(status); >+ } > > if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) { > END_PROFILE(SMBwriteunlock); >@@ -2958,6 +2971,7 @@ > char *data; > files_struct *fsp = file_fsp(inbuf,smb_vwv0); > int outsize = 0; >+ NTSTATUS status; > START_PROFILE(SMBwrite); > > /* If it's an IPC, pass off the pipe handler. */ >@@ -2968,6 +2982,7 @@ > > CHECK_FSP(fsp,conn); > if (!CHECK_WRITE(fsp)) { >+ END_PROFILE(SMBwrite); > return(ERROR_DOS(ERRDOS,ERRbadaccess)); > } > >@@ -3003,7 +3018,13 @@ > } else > nwritten = write_file(fsp,data,startpos,numtowrite); > >- sync_file(conn, fsp, False); >+ status = sync_file(conn, fsp, False); >+ if (!NT_STATUS_IS_OK(status)) { >+ END_PROFILE(SMBwrite); >+ DEBUG(5,("reply_write: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ return ERROR_NT(status); >+ } > > if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) { > END_PROFILE(SMBwrite); >@@ -3040,6 +3061,7 @@ > unsigned int smblen = smb_len(inbuf); > char *data; > BOOL large_writeX = ((CVAL(inbuf,smb_wct) == 14) && (smblen > 0xFFFF)); >+ NTSTATUS status; > START_PROFILE(SMBwriteX); > > /* If it's an IPC, pass off the pipe handler. */ >@@ -3130,7 +3152,13 @@ > DEBUG(3,("writeX fnum=%d num=%d wrote=%d\n", > fsp->fnum, (int)numtowrite, (int)nwritten)); > >- sync_file(conn, fsp, write_through); >+ status = sync_file(conn, fsp, write_through); >+ if (!NT_STATUS_IS_OK(status)) { >+ END_PROFILE(SMBwriteX); >+ DEBUG(5,("reply_write_and_X: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ return ERROR_NT(status); >+ } > > END_PROFILE(SMBwriteX); > return chain_reply(inbuf,outbuf,length,bufsize); >@@ -3227,7 +3255,13 @@ > if (!fsp) { > file_sync_all(conn); > } else { >- sync_file(conn,fsp, True); >+ NTSTATUS status = sync_file(conn, fsp, True); >+ if (!NT_STATUS_IS_OK(status)) { >+ END_PROFILE(SMBflush); >+ DEBUG(5,("reply_flush: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ return ERROR_NT(status); >+ } > } > > DEBUG(3,("flush\n")); >@@ -5831,6 +5865,7 @@ > int smb_doff; > char *data; > files_struct *fsp = file_fsp(inbuf,smb_vwv0); >+ NTSTATUS status; > START_PROFILE(SMBwriteBmpx); > > CHECK_FSP(fsp,conn); >@@ -5860,7 +5895,13 @@ > > nwritten = write_file(fsp,data,startpos,numtowrite); > >- sync_file(conn, fsp, write_through); >+ status = sync_file(conn, fsp, write_through); >+ if (!NT_STATUS_IS_OK(status)) { >+ END_PROFILE(SMBwriteBmpx); >+ DEBUG(5,("reply_writebmpx: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ return ERROR_NT(status); >+ } > > if(nwritten < (ssize_t)numtowrite) { > END_PROFILE(SMBwriteBmpx); >@@ -5936,6 +5977,7 @@ > write_bmpx_struct *wbms; > BOOL send_response = False; > files_struct *fsp = file_fsp(inbuf,smb_vwv0); >+ NTSTATUS status; > START_PROFILE(SMBwriteBs); > > CHECK_FSP(fsp,conn); >@@ -5972,9 +6014,9 @@ > > nwritten = write_file(fsp,data,startpos,numtowrite); > >- sync_file(conn, fsp, write_through); >+ status = sync_file(conn, fsp, write_through); > >- if (nwritten < (ssize_t)numtowrite) { >+ if (nwritten < (ssize_t)numtowrite || !NT_STATUS_IS_OK(status)) { > if(write_through) { > /* We are returning an error - we can delete the aux struct */ > if (wbms) >Index: smbd/fileio.c >=================================================================== >--- smbd/fileio.c (revision 23507) >+++ smbd/fileio.c (working copy) >@@ -834,16 +834,23 @@ > sync a file > ********************************************************************/ > >-void sync_file(connection_struct *conn, files_struct *fsp, BOOL write_through) >+NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, BOOL write_through) > { > if (fsp->fh->fd == -1) >- return; >+ return NT_STATUS_INVALID_HANDLE; > > if (lp_strict_sync(SNUM(conn)) && > (lp_syncalways(SNUM(conn)) || write_through)) { >- flush_write_cache(fsp, SYNC_FLUSH); >- SMB_VFS_FSYNC(fsp,fsp->fh->fd); >+ int ret = flush_write_cache(fsp, SYNC_FLUSH); >+ if (ret == -1) { >+ return map_nt_error_from_unix(errno); >+ } >+ ret = SMB_VFS_FSYNC(fsp,fsp->fh->fd); >+ if (ret == -1) { >+ return map_nt_error_from_unix(errno); >+ } > } >+ return NT_STATUS_OK; > } > > /************************************************************ >Index: smbd/aio.c >=================================================================== >--- smbd/aio.c (revision 23507) >+++ smbd/aio.c (working copy) >@@ -497,6 +497,7 @@ > ret = errno; > } else { > BOOL write_through = BITSETW(aio_ex->inbuf+smb_vwv7,0); >+ NTSTATUS status; > > SSVAL(outbuf,smb_vwv2,nwritten); > SSVAL(outbuf,smb_vwv4,(nwritten>>16)&1); >@@ -507,7 +508,13 @@ > > DEBUG(3,("handle_aio_write: fnum=%d num=%d wrote=%d\n", > fsp->fnum, (int)numtowrite, (int)nwritten)); >- sync_file(fsp->conn,fsp, write_through); >+ status = sync_file(fsp->conn,fsp, write_through); >+ if (!NT_STATUS_IS_OK(status)) { >+ UNIXERROR(ERRHRD,ERRdiskfull); >+ ret = errno; >+ DEBUG(5,("handle_aio_write: sync_file for %s returned %s\n", >+ fsp->fsp_name, nt_errstr(status) )); >+ } > } > > show_msg(outbuf);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244848
: 157370 |
157371