]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc:file must be empty when writing layout fields of file use "setfattr" 6848/head
authorCilang Zhao <zhao.cilang@h3c.com>
Tue, 8 Dec 2015 08:45:34 +0000 (03:45 -0500)
committerCilang Zhao <zhao.cilang@h3c.com>
Tue, 8 Dec 2015 08:45:43 +0000 (03:45 -0500)
When the layout fields of a file are modified, this file must be empty, otherwise an error would occur.

Signed-off-by:Cilang Zhao zhao.cilang@h3c.com

doc/cephfs/file-layouts.rst

index 95be8ae3e577242e8173f7cbae015301f71b0660..c09d8f548ed3e6e525273013087f38e9ce4e5078 100644 (file)
@@ -95,7 +95,22 @@ Layout fields are modified using ``setfattr``:
     $ setfattr -n ceph.file.layout.pool -v 1 file2  # Setting pool by ID
     $ setfattr -n ceph.file.layout.pool -v cephfs_data file2  # Setting pool by name
 
+.. note::
+
+    When the layout fields of a file are modified using ``setfattr``, this file must be empty, otherwise an error will occur.
+
+.. code-block:: bash
+
+    # touch an empty file
+    $ touch file1
+    # modify layout field successfully
+    $ setfattr -n ceph.file.layout.stripe_count -v 3 file1
 
+    # write something to file1
+    $ echo "hello world" > file1
+    $ setfattr -n ceph.file.layout.stripe_count -v 4 file1
+    setfattr: file1: Directory not empty
+    
 Inheritance of layouts
 ----------------------