Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
* [CIFS][PATCH] log warning once if out of disk space error on write
@ 2020-02-05 23:04 Steve French
  2020-02-05 23:36 ` Pavel Shilovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2020-02-05 23:04 UTC (permalink / raw)
  To: CIFS

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

Had a confusing problem reported - turned out to be out of disk space
due to a write with large offset on a non-sparse file.  Having a
warning message logged once would have helped.



-- 
Thanks,

Steve

[-- Attachment #2: 0001-cifs-log-warning-message-once-if-out-of-disk-space.patch --]
[-- Type: text/x-patch, Size: 1299 bytes --]

From 7326217e700e293beca1f8b39cdf11ba1d248438 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Wed, 5 Feb 2020 16:52:11 -0600
Subject: [PATCH] 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:

  x[ 8407.391909] Out of space writing to \\oleg-server\small-share

Signed-off-by: Steve French <stfrench@microsoft.com>
Reported-by: Oleg Kravtsov <oleg@tuxera.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/smb2pdu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 7996d81230aa..1a732ff71de4 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,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [CIFS][PATCH] log warning once if out of disk space error on write
  2020-02-05 23:04 [CIFS][PATCH] log warning once if out of disk space error on write Steve French
@ 2020-02-05 23:36 ` Pavel Shilovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Shilovsky @ 2020-02-05 23:36 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS

Looks good.

Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>

--
Best regards,
Pavel Shilovsky

ср, 5 февр. 2020 г. в 15:09, Steve French <smfrench@gmail.com>:
>
> Had a confusing problem reported - turned out to be out of disk space
> due to a write with large offset on a non-sparse file.  Having a
> warning message logged once would have helped.
>
>
>
> --
> Thanks,
>
> Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 23:04 [CIFS][PATCH] log warning once if out of disk space error on write Steve French
2020-02-05 23:36 ` Pavel Shilovsky

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git