From: Steve French Date: Wed, 5 Feb 2020 22:52:11 +0000 (-0600) Subject: cifs: log warning message (once) if out of disk space X-Git-Tag: v5.6-rc1~4^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6fd41905ec577851734623fb905b1763801f5ef;p=thirdparty%2Flinux.git cifs: log warning message (once) if out of disk space We ran into a confusing problem where an application wasn't checking return code on close and so user didn't realize that the application ran out of disk space. log a warning message (once) in these cases. For example: [ 8407.391909] Out of space writing to \\oleg-server\small-share Signed-off-by: Steve French Reported-by: Oleg Kravtsov Reviewed-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky --- diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 7996d81230aae..1a732ff71de4b 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -4029,6 +4029,9 @@ smb2_writev_callback(struct mid_q_entry *mid) wdata->cfile->fid.persistent_fid, tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes, wdata->result); + if (wdata->result == -ENOSPC) + printk_once(KERN_WARNING "Out of space writing to %s\n", + tcon->treeName); } else trace_smb3_write_done(0 /* no xid */, wdata->cfile->fid.persistent_fid,